Package org.wso2.carbon.utils.logging
Class CarbonAuditLog
- java.lang.Object
-
- org.wso2.carbon.utils.logging.CarbonAuditLog
-
- All Implemented Interfaces:
org.apache.commons.logging.Log
public class CarbonAuditLog extends Object implements org.apache.commons.logging.Log
CarbonAuditLog is a wrapper implementation of the Log interface from Apache Commons Logging. This class is used to provide a standardized way to log audit messages, with additional context information appended to each log entry. The class ensures to append MDC (Mapped Diagnostic Context) properties to each log message before passing it to the underlying logger. The MDC properties allow you to add context-specific information to log messages. In this implementation, impersonation details are appended to the log messages if available. Usage: - Instantiate the CarbonAuditLog class and use its methods to log messages. - The class uses a static Log instance named AUDIT_LOG to log messages with the "AUDIT_LOG" name. - MDC properties can be appended to log messages to include additional context information.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogAUDIT_LOG
-
Constructor Summary
Constructors Constructor Description CarbonAuditLog()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(Object o)voiddebug(Object o, Throwable throwable)voiderror(Object o)voiderror(Object o, Throwable throwable)voidfatal(Object o)voidfatal(Object o, Throwable throwable)voidinfo(Object o)voidinfo(Object o, Throwable throwable)booleanisDebugEnabled()booleanisErrorEnabled()booleanisFatalEnabled()booleanisInfoEnabled()booleanisTraceEnabled()booleanisWarnEnabled()voidtrace(Object o)voidtrace(Object o, Throwable throwable)voidwarn(Object o)voidwarn(Object o, Throwable throwable)
-
-
-
Method Detail
-
debug
public void debug(Object o)
- Specified by:
debugin interfaceorg.apache.commons.logging.Log
-
debug
public void debug(Object o, Throwable throwable)
- Specified by:
debugin interfaceorg.apache.commons.logging.Log
-
error
public void error(Object o)
- Specified by:
errorin interfaceorg.apache.commons.logging.Log
-
error
public void error(Object o, Throwable throwable)
- Specified by:
errorin interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(Object o)
- Specified by:
fatalin interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(Object o, Throwable throwable)
- Specified by:
fatalin interfaceorg.apache.commons.logging.Log
-
info
public void info(Object o)
- Specified by:
infoin interfaceorg.apache.commons.logging.Log
-
info
public void info(Object o, Throwable throwable)
- Specified by:
infoin interfaceorg.apache.commons.logging.Log
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabledin interfaceorg.apache.commons.logging.Log
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabledin interfaceorg.apache.commons.logging.Log
-
isFatalEnabled
public boolean isFatalEnabled()
- Specified by:
isFatalEnabledin interfaceorg.apache.commons.logging.Log
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabledin interfaceorg.apache.commons.logging.Log
-
isTraceEnabled
public boolean isTraceEnabled()
- Specified by:
isTraceEnabledin interfaceorg.apache.commons.logging.Log
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabledin interfaceorg.apache.commons.logging.Log
-
trace
public void trace(Object o)
- Specified by:
tracein interfaceorg.apache.commons.logging.Log
-
trace
public void trace(Object o, Throwable throwable)
- Specified by:
tracein interfaceorg.apache.commons.logging.Log
-
warn
public void warn(Object o)
- Specified by:
warnin interfaceorg.apache.commons.logging.Log
-
-