Package com.mapr.log4j
Class MaprfsDailyRollingLogAppender
- java.lang.Object
-
- org.apache.log4j.AppenderSkeleton
-
- com.mapr.log4j.MaprfsLogAppender
-
- com.mapr.log4j.MaprfsDailyRollingLogAppender
-
- All Implemented Interfaces:
java.io.Flushable,org.apache.hadoop.fs.Syncable,org.apache.log4j.Appender,org.apache.log4j.spi.OptionHandler
public class MaprfsDailyRollingLogAppender extends MaprfsLogAppender
DailyRollingLogAppender for MapRFS - majority of functionality is from DailyRollingFileAppender with enhanced asynch. handling of old files removal
-
-
Field Summary
-
Fields inherited from class com.mapr.log4j.MaprfsLogAppender
BUFFER_SIZE, DIR_PREFIX, failoverAppender, failoverAppenderName, fileName, fileNamePath, immediateFlush, immediateSync, maprFS, nameHierarchy, syncIntervalSeconds, uri
-
-
Constructor Summary
Constructors Constructor Description MaprfsDailyRollingLogAppender()MaprfsDailyRollingLogAppender(java.net.URI uri, java.lang.String datePattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateOptions()protected voidappend(org.apache.log4j.spi.LoggingEvent event)This method differentiates DailyRollingFileAppender from its super class.java.lang.StringgetDatePattern()Returns the value of the DatePattern option.intgetMaxBackupIndex()voidsetDatePattern(java.lang.String pattern)The DatePattern takes a string in the same format as expected bySimpleDateFormat.voidsetMaxBackupIndex(int maxBackups)-
Methods inherited from class com.mapr.log4j.MaprfsLogAppender
close, closeFile, createFile, failoverToLocalLogs, flush, getFile, getFileSize, getImmediateFlush, getImmediateSync, getLogFilePermission, getSyncIntervalSeconds, hflush, hsync, requiresLayout, setFailoverAppender, setFile, setFS, setImmediateFlush, setImmediateSync, setSyncIntervalSeconds, setURI, sync, writeFooter, writeHeader
-
-
-
-
Method Detail
-
setDatePattern
public void setDatePattern(java.lang.String pattern)
The DatePattern takes a string in the same format as expected bySimpleDateFormat. This options determines the rollover schedule.
-
getDatePattern
public java.lang.String getDatePattern()
Returns the value of the DatePattern option.
-
setMaxBackupIndex
public void setMaxBackupIndex(int maxBackups)
-
getMaxBackupIndex
public int getMaxBackupIndex()
-
activateOptions
public void activateOptions()
- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler- Overrides:
activateOptionsin classMaprfsLogAppender
-
append
protected void append(org.apache.log4j.spi.LoggingEvent event)
This method differentiates DailyRollingFileAppender from its super class.Before actually logging, this method will check whether it is time to do a rollover. If it is, it will schedule the next rollover time and then rollover.
- Overrides:
appendin classMaprfsLogAppender
-
-