com.atlassian.jira.logging
Class JiraHomeAppender

java.lang.Object
  extended by com.atlassian.jira.logging.JiraHomeAppender
All Implemented Interfaces:
RollOverLogAppender, org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public final class JiraHomeAppender
extends Object
implements org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler, RollOverLogAppender

A log4j appender that will log output data to the JIRA.HOME/log directory. It accepts the same options as the RollingFileAppender.

The appender may be called before JIRA.HOME is ready to be used. In this situtation the appender will buffer the log events until the JIRA.HOME is ready. Once ready, all the events will be flushed in order.

The appender will revert to its old behaviour (creating a file in the working directory) if JIRA.HOME is not configured correctly.

Since:
v4.1

Constructor Summary
JiraHomeAppender(JiraHomeStartupCheck startupCheck)
           
 
Method Summary
 void activateOptions()
           
 void addFilter(org.apache.log4j.spi.Filter newFilter)
           
 void clearFilters()
           
 void close()
           
 void doAppend(org.apache.log4j.spi.LoggingEvent event)
           
 boolean getAppend()
           
 boolean getBufferedIO()
           
 int getBufferSize()
           
 String getEncoding()
           
 org.apache.log4j.spi.ErrorHandler getErrorHandler()
           
 String getFile()
           
 org.apache.log4j.spi.Filter getFilter()
           
 org.apache.log4j.spi.Filter getFirstFilter()
           
 boolean getImmediateFlush()
           
 org.apache.log4j.Layout getLayout()
           
 int getMaxBackupIndex()
           
 long getMaximumFileSize()
           
 String getName()
           
 org.apache.log4j.Priority getThreshold()
           
 boolean requiresLayout()
           
 void rollOver()
          Cause a log rollover to happen
 void setAppend(boolean flag)
           
 void setBufferedIO(boolean bufferedIO)
           
 void setBufferSize(int bufferSize)
           
 void setEncoding(String value)
           
 void setErrorHandler(org.apache.log4j.spi.ErrorHandler eh)
           
 void setFile(String file)
           
 void setImmediateFlush(boolean value)
           
 void setLayout(org.apache.log4j.Layout layout)
           
 void setMaxBackupIndex(int maxBackups)
           
 void setMaxFileSize(String value)
           
 void setMaximumFileSize(long maxFileSize)
           
 void setName(String name)
           
 void setThreshold(org.apache.log4j.Priority threshold)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraHomeAppender

public JiraHomeAppender(JiraHomeStartupCheck startupCheck)
Method Detail

getMaxBackupIndex

public int getMaxBackupIndex()

getMaximumFileSize

public long getMaximumFileSize()

setMaxBackupIndex

public void setMaxBackupIndex(int maxBackups)

setMaximumFileSize

public void setMaximumFileSize(long maxFileSize)

setMaxFileSize

public void setMaxFileSize(String value)

setFile

public void setFile(String file)

getAppend

public boolean getAppend()

getFile

public String getFile()
Specified by:
getFile in interface RollOverLogAppender
Returns:
the name of the current log file that can be rolled over

activateOptions

public void activateOptions()
Specified by:
activateOptions in interface org.apache.log4j.spi.OptionHandler

getBufferedIO

public boolean getBufferedIO()

getBufferSize

public int getBufferSize()

setAppend

public void setAppend(boolean flag)

setBufferedIO

public void setBufferedIO(boolean bufferedIO)

setBufferSize

public void setBufferSize(int bufferSize)

setImmediateFlush

public void setImmediateFlush(boolean value)

getImmediateFlush

public boolean getImmediateFlush()

close

public void close()
Specified by:
close in interface org.apache.log4j.Appender

getEncoding

public String getEncoding()

setEncoding

public void setEncoding(String value)

setErrorHandler

public void setErrorHandler(org.apache.log4j.spi.ErrorHandler eh)
Specified by:
setErrorHandler in interface org.apache.log4j.Appender

requiresLayout

public boolean requiresLayout()
Specified by:
requiresLayout in interface org.apache.log4j.Appender

addFilter

public void addFilter(org.apache.log4j.spi.Filter newFilter)
Specified by:
addFilter in interface org.apache.log4j.Appender

clearFilters

public void clearFilters()
Specified by:
clearFilters in interface org.apache.log4j.Appender

getErrorHandler

public org.apache.log4j.spi.ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface org.apache.log4j.Appender

getFilter

public org.apache.log4j.spi.Filter getFilter()
Specified by:
getFilter in interface org.apache.log4j.Appender

getFirstFilter

public org.apache.log4j.spi.Filter getFirstFilter()

getLayout

public org.apache.log4j.Layout getLayout()
Specified by:
getLayout in interface org.apache.log4j.Appender

getName

public String getName()
Specified by:
getName in interface org.apache.log4j.Appender

getThreshold

public org.apache.log4j.Priority getThreshold()

setLayout

public void setLayout(org.apache.log4j.Layout layout)
Specified by:
setLayout in interface org.apache.log4j.Appender

setName

public void setName(String name)
Specified by:
setName in interface org.apache.log4j.Appender

setThreshold

public void setThreshold(org.apache.log4j.Priority threshold)

doAppend

public void doAppend(org.apache.log4j.spi.LoggingEvent event)
Specified by:
doAppend in interface org.apache.log4j.Appender

rollOver

public void rollOver()
Description copied from interface: RollOverLogAppender
Cause a log rollover to happen

Specified by:
rollOver in interface RollOverLogAppender


Copyright © 2002-2012 Atlassian. All Rights Reserved.