org.wso2.carbon.utils.logging.appenders
Class CarbonDailyRollingFileAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.apache.log4j.WriterAppender
          extended by org.apache.log4j.FileAppender
              extended by org.apache.log4j.DailyRollingFileAppender
                  extended by org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler, org.wso2.carbon.bootstrap.logging.LoggingBridge

public class CarbonDailyRollingFileAppender
extends org.apache.log4j.DailyRollingFileAppender
implements org.wso2.carbon.bootstrap.logging.LoggingBridge


Field Summary
 
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
 
Constructor Summary
CarbonDailyRollingFileAppender()
           
 
Method Summary
 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.DailyRollingFileAppender
activateOptions, getDatePattern, setDatePattern
 
Methods inherited from class org.apache.log4j.FileAppender
closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile, setFile, setQWForFiles
 
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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CarbonDailyRollingFileAppender

public CarbonDailyRollingFileAppender()
Method Detail

push

public void push(LogRecord record)
Specified by:
push in interface org.wso2.carbon.bootstrap.logging.LoggingBridge

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.DailyRollingFileAppender
Parameters:
loggingEvent - - the logging event without tenant information


Copyright © 2014 WSO2 Inc. All rights reserved.