Class MaprfsRollingLogAppender
- java.lang.Object
-
- org.apache.log4j.AppenderSkeleton
-
- com.mapr.log4j.MaprfsLogAppender
-
- com.mapr.log4j.MaprfsRollingLogAppender
-
- All Implemented Interfaces:
java.io.Flushable,org.apache.hadoop.fs.Syncable,org.apache.log4j.Appender,org.apache.log4j.spi.OptionHandler
public class MaprfsRollingLogAppender extends MaprfsLogAppender
RollingLogAppender for MapRFS. Majority of functionality is from RollingFileAppender
-
-
Field Summary
Fields Modifier and Type Field Description protected intmaxBackupIndexThere is one backup file by default.protected longmaxFileSizeThe default maximum file size is 10MB.-
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 MaprfsRollingLogAppender()MaprfsRollingLogAppender(java.net.URI uri, long maxSize, int maxBackupIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(org.apache.log4j.spi.LoggingEvent event)intgetMaxBackupIndex()Returns the value of the MaxBackupIndex option.longgetMaximumFileSize()Get the maximum size that the output file is allowed to reach before being rolled over to backup files.voidsetMaxBackupIndex(int maxBackups)Set the maximum number of backup files to keep around.voidsetMaxFileSize(java.lang.String value)Set the maximum size that the output file is allowed to reach before being rolled over to backup files.voidsetMaximumFileSize(long maxFileSize)Set the maximum size that the output file is allowed to reach before being rolled over to backup files.-
Methods inherited from class com.mapr.log4j.MaprfsLogAppender
activateOptions, 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
-
getMaxBackupIndex
public int getMaxBackupIndex()
Returns the value of the MaxBackupIndex option.
-
getMaximumFileSize
public long getMaximumFileSize()
Get the maximum size that the output file is allowed to reach before being rolled over to backup files.
-
setMaxBackupIndex
public void setMaxBackupIndex(int maxBackups)
Set the maximum number of backup files to keep around.The MaxBackupIndex option determines how many backup files are kept before the oldest is erased. This option takes a positive integer value. If set to zero, then there will be no backup files and the log file will be truncated when it reaches
MaxFileSize.
-
setMaximumFileSize
public void setMaximumFileSize(long maxFileSize)
Set the maximum size that the output file is allowed to reach before being rolled over to backup files.This method is equivalent to
setMaxFileSize(java.lang.String)except that it is required for differentiating the setter taking alongargument from the setter taking aStringargument by the JavaBeansIntrospector.- See Also:
setMaxFileSize(String)
-
setMaxFileSize
public void setMaxFileSize(java.lang.String value)
Set the maximum size that the output file is allowed to reach before being rolled over to backup files.In configuration files, the MaxFileSize option takes an long integer in the range 0 - 2^63. You can specify the value with the suffixes "KB", "MB" or "GB" so that the integer is interpreted being expressed respectively in kilobytes, megabytes or gigabytes. For example, the value "10KB" will be interpreted as 10240.
-
append
protected void append(org.apache.log4j.spi.LoggingEvent event)
- Overrides:
appendin classMaprfsLogAppender
-
-