Class 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 Detail

      • AUDIT_LOG

        public static final org.apache.commons.logging.Log AUDIT_LOG
    • Constructor Detail

      • CarbonAuditLog

        public CarbonAuditLog()
    • Method Detail

      • debug

        public void debug​(Object o)
        Specified by:
        debug in interface org.apache.commons.logging.Log
      • debug

        public void debug​(Object o,
                          Throwable throwable)
        Specified by:
        debug in interface org.apache.commons.logging.Log
      • error

        public void error​(Object o)
        Specified by:
        error in interface org.apache.commons.logging.Log
      • error

        public void error​(Object o,
                          Throwable throwable)
        Specified by:
        error in interface org.apache.commons.logging.Log
      • fatal

        public void fatal​(Object o)
        Specified by:
        fatal in interface org.apache.commons.logging.Log
      • fatal

        public void fatal​(Object o,
                          Throwable throwable)
        Specified by:
        fatal in interface org.apache.commons.logging.Log
      • info

        public void info​(Object o)
        Specified by:
        info in interface org.apache.commons.logging.Log
      • info

        public void info​(Object o,
                         Throwable throwable)
        Specified by:
        info in interface org.apache.commons.logging.Log
      • isDebugEnabled

        public boolean isDebugEnabled()
        Specified by:
        isDebugEnabled in interface org.apache.commons.logging.Log
      • isErrorEnabled

        public boolean isErrorEnabled()
        Specified by:
        isErrorEnabled in interface org.apache.commons.logging.Log
      • isFatalEnabled

        public boolean isFatalEnabled()
        Specified by:
        isFatalEnabled in interface org.apache.commons.logging.Log
      • isInfoEnabled

        public boolean isInfoEnabled()
        Specified by:
        isInfoEnabled in interface org.apache.commons.logging.Log
      • isTraceEnabled

        public boolean isTraceEnabled()
        Specified by:
        isTraceEnabled in interface org.apache.commons.logging.Log
      • isWarnEnabled

        public boolean isWarnEnabled()
        Specified by:
        isWarnEnabled in interface org.apache.commons.logging.Log
      • trace

        public void trace​(Object o)
        Specified by:
        trace in interface org.apache.commons.logging.Log
      • trace

        public void trace​(Object o,
                          Throwable throwable)
        Specified by:
        trace in interface org.apache.commons.logging.Log
      • warn

        public void warn​(Object o)
        Specified by:
        warn in interface org.apache.commons.logging.Log
      • warn

        public void warn​(Object o,
                         Throwable throwable)
        Specified by:
        warn in interface org.apache.commons.logging.Log