Package org.apache.velocity.runtime.log
Class JdkLogChute
- java.lang.Object
-
- org.apache.velocity.runtime.log.JdkLogChute
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_LOG_NAME
Default name for the JDK logger instanceprotected java.util.logging.Logger
logger
static java.lang.String
RUNTIME_LOG_JDK_LOGGER
Property key for specifying the name for the logger instancestatic java.lang.String
RUNTIME_LOG_JDK_LOGGER_LEVEL
-
Fields inherited from interface org.apache.velocity.runtime.log.LogChute
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX
-
-
Constructor Summary
Constructors Constructor Description JdkLogChute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.logging.Level
getJdkLevel(int level)
Returns the java.util.logging.Level that matches to the specified LogChute level.void
init(RuntimeServices rs)
Initializes this LogChute.boolean
isLevelEnabled(int level)
Tell whether or not a log level is enabled.void
log(int level, java.lang.String message)
Logs messagesvoid
log(int level, java.lang.String message, java.lang.Throwable t)
Send a log message from Velocity along with an exception or error
-
-
-
Field Detail
-
RUNTIME_LOG_JDK_LOGGER
public static final java.lang.String RUNTIME_LOG_JDK_LOGGER
Property key for specifying the name for the logger instance- See Also:
- Constant Field Values
-
RUNTIME_LOG_JDK_LOGGER_LEVEL
public static final java.lang.String RUNTIME_LOG_JDK_LOGGER_LEVEL
- See Also:
- Constant Field Values
-
DEFAULT_LOG_NAME
public static final java.lang.String DEFAULT_LOG_NAME
Default name for the JDK logger instance- See Also:
- Constant Field Values
-
logger
protected java.util.logging.Logger logger
-
-
Method Detail
-
init
public void init(RuntimeServices rs)
Description copied from interface:LogChute
Initializes this LogChute.- Specified by:
init
in interfaceLogChute
- See Also:
LogChute.init(org.apache.velocity.runtime.RuntimeServices)
-
getJdkLevel
protected java.util.logging.Level getJdkLevel(int level)
Returns the java.util.logging.Level that matches to the specified LogChute level.- Parameters:
level
-- Returns:
- The current log level of the JDK Logger.
-
log
public void log(int level, java.lang.String message)
Logs messages
-
log
public void log(int level, java.lang.String message, java.lang.Throwable t)
Send a log message from Velocity along with an exception or error
-
isLevelEnabled
public boolean isLevelEnabled(int level)
Description copied from interface:LogChute
Tell whether or not a log level is enabled.- Specified by:
isLevelEnabled
in interfaceLogChute
- Returns:
- True if a level is enabled.
- See Also:
LogChute.isLevelEnabled(int)
-
-