public class ServletLogChute extends Object implements LogChute
Modifier and Type | Field and Description |
---|---|
static String |
PREFIX |
static String |
RUNTIME_LOG_LEVEL_KEY |
protected javax.servlet.ServletContext |
servletContext |
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX
Constructor and Description |
---|
ServletLogChute()
Construct a simple logger for a servlet environment.
|
Modifier and Type | Method and Description |
---|---|
int |
getEnabledLevel()
Returns the current minimum level at which messages will be printed.
|
void |
init(RuntimeServices rs)
init()
|
boolean |
isLevelEnabled(int level)
This will return true if the specified level
is equal to or higher than the level this
LogChute is enabled for.
|
void |
log(int level,
String message)
Send a log message from Velocity.
|
void |
log(int level,
String message,
Throwable t)
Send a log message from Velocity along with an exception or error
|
void |
setEnabledLevel(int level)
Set the minimum level at which messages will be printed.
|
protected int |
toLevel(String level) |
public static final String RUNTIME_LOG_LEVEL_KEY
protected javax.servlet.ServletContext servletContext
public static final String PREFIX
public ServletLogChute()
public void init(RuntimeServices rs) throws Exception
init
in interface LogChute
IllegalStateException
- if the ServletContext is not available
in the application attributes under the appropriate key.Exception
protected int toLevel(String level)
public void setEnabledLevel(int level)
public int getEnabledLevel()
public boolean isLevelEnabled(int level)
isLevelEnabled
in interface LogChute
public void log(int level, String message)
Copyright © 2000–2018. All rights reserved.