Package org.bedework.util.logging
Class BwLogger
- java.lang.Object
-
- org.bedework.util.logging.BwLogger
-
public class BwLogger extends Object
This class provides basic logging support. It also allows for some log messages to be output to multiple loggers. Each stream will be for this class possible prefixed by name + ".". User: mike Date: 12/11/18 Time: 15:51
-
-
Field Summary
Fields Modifier and Type Field Description static StringauditLoggerNamestatic StringerrorLoggerNameprotected Class<?>loggedClassprotected StringloggedNamestatic StringmetricsLoggerName
-
Constructor Summary
Constructors Constructor Description BwLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaudit(String msg)booleandebug()voiddebug(String msg)voidenableAuditLogger()voidenableErrorLogger()voidenableMetricsLogger()voiderror(String msg)voiderror(String msg, Throwable t)voiderror(Throwable t)protected org.apache.logging.log4j.LoggergetAuditLoggerIfEnabled()protected org.apache.logging.log4j.LoggergetErrorLoggerIfEnabled()Class<?>getLoggedClass()StringgetLoggedName()protected org.apache.logging.log4j.LoggergetLogger()protected org.apache.logging.log4j.LoggergetLogger(String name)LevelgetLogLevel(String className)protected org.apache.logging.log4j.LoggergetMetricsLoggerIfEnabled()voidinfo(String msg)booleanisAuditLoggerEnabled()booleanisDebugEnabled()booleanisErrorLoggerEnabled()booleanisMetricsDebugEnabled()booleanisMetricsLoggerEnabled()booleanisTraceEnabled()voidmetrics(String msg)BwLoggersetLoggedClass(Class<?> cl)BwLoggersetLoggedName(String name)voidtrace(String msg)voidwarn(String msg)
-
-
-
Field Detail
-
loggedClass
protected Class<?> loggedClass
-
loggedName
protected String loggedName
-
errorLoggerName
public static final String errorLoggerName
- See Also:
- Constant Field Values
-
auditLoggerName
public static final String auditLoggerName
- See Also:
- Constant Field Values
-
metricsLoggerName
public static final String metricsLoggerName
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLoggedClass
public Class<?> getLoggedClass()
-
getLoggedName
public String getLoggedName()
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()
- Returns:
- Logger
-
getLogger
protected org.apache.logging.log4j.Logger getLogger(String name)
- Returns:
- Logger
-
getErrorLoggerIfEnabled
protected org.apache.logging.log4j.Logger getErrorLoggerIfEnabled()
-
getAuditLoggerIfEnabled
protected org.apache.logging.log4j.Logger getAuditLoggerIfEnabled()
-
getMetricsLoggerIfEnabled
protected org.apache.logging.log4j.Logger getMetricsLoggerIfEnabled()
-
enableErrorLogger
public void enableErrorLogger()
-
enableAuditLogger
public void enableAuditLogger()
-
enableMetricsLogger
public void enableMetricsLogger()
-
debug
public boolean debug()
-
isDebugEnabled
public boolean isDebugEnabled()
-
isMetricsDebugEnabled
public boolean isMetricsDebugEnabled()
-
isTraceEnabled
public boolean isTraceEnabled()
-
isErrorLoggerEnabled
public boolean isErrorLoggerEnabled()
-
isAuditLoggerEnabled
public boolean isAuditLoggerEnabled()
-
isMetricsLoggerEnabled
public boolean isMetricsLoggerEnabled()
-
error
public void error(Throwable t)
- Parameters:
t- exception
-
error
public void error(String msg)
- Parameters:
msg- to output
-
warn
public void warn(String msg)
- Parameters:
msg- to output
-
info
public void info(String msg)
- Parameters:
msg- to output
-
audit
public void audit(String msg)
- Parameters:
msg- to output
-
metrics
public void metrics(String msg)
- Parameters:
msg- to output
-
debug
public void debug(String msg)
- Parameters:
msg- to output
-
trace
public void trace(String msg)
- Parameters:
msg- to output
-
-