public class AppLogAppender
extends org.apache.log4j.FileAppender
Modifier and Type | Class and Description |
---|---|
class |
AppLogAppender.AppenderFile |
Constructor and Description |
---|
AppLogAppender(java.lang.String directory,
java.lang.String prefix,
java.lang.String suffix)
Creates a new
DatedFileAppender
with the specified characteristics. |
Modifier and Type | Method and Description |
---|---|
void |
activateOptions()
Called once all options have been set on this Appender.
|
void |
append(org.apache.log4j.spi.LoggingEvent event)
Called by AppenderSkeleton.doAppend() to write a log message formatted
according to the layout defined for this appender.
|
java.util.LinkedList<AppLogAppender.AppenderFile> |
getActiveFiles() |
java.lang.String |
getDirectory()
Return the directory in which we create log files.
|
int |
getFilesToKeep() |
long |
getMaxFileSize() |
java.lang.String |
getPrefix()
Return the log file prefix.
|
java.lang.String |
getSuffix()
Return the log file suffix.
|
void |
setDirectory(java.lang.String directory)
Set the directory in which we create log files.
|
void |
setFilesToKeep(int filesToKeep) |
void |
setMaxFileSize(long maxFileSize) |
void |
setPrefix(java.lang.String prefix)
Set the log file prefix.
|
void |
setSuffix(java.lang.String suffix)
Set the log file suffix.
|
static void |
tomorrow(java.util.Calendar calendar)
Sets a calendar to the start of tomorrow,
with all time values reset to zero.
|
getAppend, getBufferedIO, getBufferSize, getFile, setAppend, setBufferedIO, setBufferSize, setFile, setFile
close, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter
public AppLogAppender(java.lang.String directory, java.lang.String prefix, java.lang.String suffix)
DatedFileAppender
with the specified characteristics.directory
- the directory in which log files are created.prefix
- the prefix that is added to log file filenames.suffix
- the suffix that is added to log file filenames.public java.lang.String getDirectory()
public void setDirectory(java.lang.String directory)
directory
- The new log file directorypublic java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix)
prefix
- The new log file prefixpublic java.lang.String getSuffix()
public void setSuffix(java.lang.String suffix)
suffix
- The new log file suffixpublic void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
activateOptions
in class org.apache.log4j.FileAppender
public void append(org.apache.log4j.spi.LoggingEvent event)
append
in class org.apache.log4j.WriterAppender
public static void tomorrow(java.util.Calendar calendar)
Takes advantage of the fact that the Java Calendar implementations are mercifully accommodating in handling non-existent dates. For example, June 31 is understood to mean July 1. This allows you to simply add one to today's day of the month to generate tomorrow's date. It also works for years, so that December 32, 2004 is converted into January 1, 2005.
public java.util.LinkedList<AppLogAppender.AppenderFile> getActiveFiles()
public int getFilesToKeep()
public void setFilesToKeep(int filesToKeep)
public long getMaxFileSize()
public void setMaxFileSize(long maxFileSize)