Package com.bw.jtools.log
Class Log4JLogger
- java.lang.Object
-
- com.bw.jtools.Log.LoggerFacade
-
- com.bw.jtools.log.Log4JLogger
-
public class Log4JLogger extends Log.LoggerFacade
Logger back-end for log4j2.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.logging.log4j.Loggerlog4j-
Fields inherited from class com.bw.jtools.Log.LoggerFacade
DEBUG_PREFIX, ERROR_PREFIX, INFO_PREFIX, level, maxStackTraceLines, UNKNW_PREFIX, WARN_PREFIX
-
-
Constructor Summary
Constructors Constructor Description Log4JLogger()
-
Method Summary
Modifier and Type Method Description voiddebug(java.lang.CharSequence msg)Logs a debugging message.voiderror(java.lang.CharSequence msg)Logs an error message.voiderror(java.lang.CharSequence msg, java.lang.Throwable t)Logs an error message plus message and stack-trace of the Throwable.protected intgetCurrentLog4JLevel()voidinfo(java.lang.CharSequence msg)Logs an informational message.voidinfo(java.lang.CharSequence msg, java.lang.Throwable t)Logs an informational message error plus message and stack-trace of the Throwable.booleanisDebugEnabled()Checks if debug log-output is enabled.booleanisErrorEnabled()Checks if error log-output is enabled.booleanisInfoEnabled()Checks if informational log-output is enabled.booleanisWarnEnabled()Checks if warning log-output is enabled.voidsetLevel(int level)Sets the logging level.voidwarn(java.lang.CharSequence msg)Logs a warning message.voidwarn(java.lang.CharSequence msg, java.lang.Throwable t)Logs a warning message error plus message and stack-trace of the Throwable.-
Methods inherited from class com.bw.jtools.Log.LoggerFacade
debug, getLevel, getLevelPrefix, setMaximumLinesOfStackTrace
-
-
-
-
Method Detail
-
getCurrentLog4JLevel
protected int getCurrentLog4JLevel()
-
setLevel
public void setLevel(int level)
Description copied from class:Log.LoggerFacadeSets the logging level.- Overrides:
setLevelin classLog.LoggerFacade- Parameters:
level- The level.
-
error
public void error(java.lang.CharSequence msg)
Description copied from class:Log.LoggerFacadeLogs an error message.- Specified by:
errorin classLog.LoggerFacade- Parameters:
msg- The text to log.
-
warn
public void warn(java.lang.CharSequence msg)
Description copied from class:Log.LoggerFacadeLogs a warning message.- Specified by:
warnin classLog.LoggerFacade- Parameters:
msg- The text to log.
-
info
public void info(java.lang.CharSequence msg)
Description copied from class:Log.LoggerFacadeLogs an informational message.- Specified by:
infoin classLog.LoggerFacade- Parameters:
msg- The text to log.
-
debug
public void debug(java.lang.CharSequence msg)
Description copied from class:Log.LoggerFacadeLogs a debugging message.- Specified by:
debugin classLog.LoggerFacade- Parameters:
msg- The text to log.
-
error
public void error(java.lang.CharSequence msg, java.lang.Throwable t)Description copied from class:Log.LoggerFacadeLogs an error message plus message and stack-trace of the Throwable.- Overrides:
errorin classLog.LoggerFacade- Parameters:
msg- The text to log.t- The Throwable to trace.
-
warn
public void warn(java.lang.CharSequence msg, java.lang.Throwable t)Description copied from class:Log.LoggerFacadeLogs a warning message error plus message and stack-trace of the Throwable.- Overrides:
warnin classLog.LoggerFacade- Parameters:
msg- The text to log.t- The Throwable to trace.
-
info
public void info(java.lang.CharSequence msg, java.lang.Throwable t)Description copied from class:Log.LoggerFacadeLogs an informational message error plus message and stack-trace of the Throwable.- Overrides:
infoin classLog.LoggerFacade- Parameters:
msg- The text to log.t- The Throwable to trace.
-
isDebugEnabled
public boolean isDebugEnabled()
Description copied from class:Log.LoggerFacadeChecks if debug log-output is enabled.- Overrides:
isDebugEnabledin classLog.LoggerFacade- Returns:
- true if current log-level is equal to or higher than DEBUG.
-
isInfoEnabled
public boolean isInfoEnabled()
Description copied from class:Log.LoggerFacadeChecks if informational log-output is enabled.- Overrides:
isInfoEnabledin classLog.LoggerFacade- Returns:
- true if current log-level is equal to or higher than INFO.
-
isWarnEnabled
public boolean isWarnEnabled()
Description copied from class:Log.LoggerFacadeChecks if warning log-output is enabled.- Overrides:
isWarnEnabledin classLog.LoggerFacade- Returns:
- true if current log-level is equal to or higher than WARN.
-
isErrorEnabled
public boolean isErrorEnabled()
Description copied from class:Log.LoggerFacadeChecks if error log-output is enabled.- Overrides:
isErrorEnabledin classLog.LoggerFacade- Returns:
- true if current log-level is equal to or higher than WARN.
-
-