Class CarbonRollingFileAppender

  • All Implemented Interfaces:
    org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler, LoggingBridge

    public class CarbonRollingFileAppender
    extends org.apache.log4j.RollingFileAppender
    implements LoggingBridge
    • Field Summary

      • Fields inherited from class org.apache.log4j.RollingFileAppender

        maxBackupIndex, maxFileSize
      • Fields inherited from class org.apache.log4j.FileAppender

        bufferedIO, bufferSize, fileAppend, fileName
      • Fields inherited from class org.apache.log4j.WriterAppender

        encoding, immediateFlush, qw
      • Fields inherited from class org.apache.log4j.AppenderSkeleton

        closed, errorHandler, headFilter, layout, name, tailFilter, threshold
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void push​(LogRecord record)  
      protected void subAppend​(org.apache.log4j.spi.LoggingEvent loggingEvent)
      This overriden method takes a Logging event, get it wrapped with tenant information taken from PrivilegedCarbonContext (by utilizing LoggingUtils.getTenantAwareLogEvent) and passes the TenantAwareLoggingEvent to super class.
      • Methods inherited from class org.apache.log4j.RollingFileAppender

        getMaxBackupIndex, getMaximumFileSize, rollOver, setFile, setMaxBackupIndex, setMaxFileSize, setMaximumFileSize, setQWForFiles
      • Methods inherited from class org.apache.log4j.FileAppender

        activateOptions, closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile
      • Methods inherited from class org.apache.log4j.WriterAppender

        append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, writeFooter, writeHeader
      • Methods inherited from class org.apache.log4j.AppenderSkeleton

        addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
    • Constructor Detail

      • CarbonRollingFileAppender

        public CarbonRollingFileAppender()
    • Method Detail

      • subAppend

        protected void subAppend​(org.apache.log4j.spi.LoggingEvent loggingEvent)
        This overriden method takes a Logging event, get it wrapped with tenant information taken from PrivilegedCarbonContext (by utilizing LoggingUtils.getTenantAwareLogEvent) and passes the TenantAwareLoggingEvent to super class.

        The passed TenantAwareLoggingEvent is later used in TenantAwareNamedPatternConverter to extract the required tenant information as well as other logging information.

        Overrides:
        subAppend in class org.apache.log4j.RollingFileAppender
        Parameters:
        loggingEvent - - the logging event without tenant information