com.atlassian.confluence.logging
Class ConfluenceHomeLogAppender
java.lang.Object
org.apache.log4j.AppenderSkeleton
org.apache.log4j.WriterAppender
com.atlassian.confluence.logging.ConfluenceHomeLogAppender
- All Implemented Interfaces:
- org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler
public class ConfluenceHomeLogAppender
- extends org.apache.log4j.WriterAppender
A Log4J appender which is aware of when the confluence.home property is set and will switch logging from the console
to within the confluence.home directory.
All the console logging will be buffered so that once the switch to logging in the confluence.home is made, all
existing logs can be written to this favoured location.
This appender accepts a subset of the RollingFileAppender's configuration, although while it is delegating to the
ConsoleAppender it will only use the layout settings.
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 |
ConfluenceHomeLogAppender()
Creates the delegate Appenders although they are not ready for use until activateOptions()
is called. |
Methods inherited from class org.apache.log4j.WriterAppender |
checkEntryConditions, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, reset, setEncoding, setErrorHandler, setImmediateFlush, setWriter, subAppend, writeFooter, writeHeader |
Methods inherited from class org.apache.log4j.AppenderSkeleton |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getName, getThreshold, isAsSevereAsThreshold, setName, setThreshold |
ConfluenceHomeLogAppender
public ConfluenceHomeLogAppender()
- Creates the delegate Appenders although they are not ready for use until
activateOptions()
is called.
setMaxFileSize
public void setMaxFileSize(String value)
getMaximumFileSize
public long getMaximumFileSize()
setMaxBackupIndex
public void setMaxBackupIndex(int maxBackups)
getMaxBackupIndex
public int getMaxBackupIndex()
activateOptions
public void activateOptions()
- Activate the default Appender (ConsoleAppender). The other appender will be activated once it's configuration
is known which is in response to the appropriate event.
- Specified by:
activateOptions
in interface org.apache.log4j.spi.OptionHandler
- Overrides:
activateOptions
in class org.apache.log4j.WriterAppender
- See Also:
switchAppender()
getLayout
public org.apache.log4j.Layout getLayout()
- Specified by:
getLayout
in interface org.apache.log4j.Appender
- Overrides:
getLayout
in class org.apache.log4j.AppenderSkeleton
setLayout
public void setLayout(org.apache.log4j.Layout layout)
- Specified by:
setLayout
in interface org.apache.log4j.Appender
- Overrides:
setLayout
in class org.apache.log4j.AppenderSkeleton
setLogFileName
public void setLogFileName(String file)
- Parameters:
file
- just the log file name (not the full path)
getLogFileName
public String getLogFileName()
append
public void append(org.apache.log4j.spi.LoggingEvent event)
- Append to the current delegate Appender. If this is the ConsoleAppender then also buffer the event for writing
when the RollingAppender is delegated to.
- Overrides:
append
in class org.apache.log4j.WriterAppender
- Parameters:
event
- the information to log.
close
public void close()
- Specified by:
close
in interface org.apache.log4j.Appender
- Overrides:
close
in class org.apache.log4j.WriterAppender