Class YarnCentralTaskRollingLogAppender
- All Implemented Interfaces:
Flushable,org.apache.hadoop.fs.Syncable,org.apache.log4j.Appender,org.apache.log4j.spi.OptionHandler
YarnCentralTaskLogAppender#activateOptions. Since we cannot
inherit from 2 classes, and the code is fairly small, we did not refactor.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThere is one backup file by default.protected longThe 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, uriFields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(org.apache.log4j.spi.LoggingEvent event) protected LongThis method is overridden to disable the max event based log file truncation in CentralTaskLogAppender.intReturns the value of the MaxBackupIndex option.longGet 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(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.YarnCentralTaskLogAppender
getFrameworkType, getLogFilePermissionMethods inherited from class com.mapr.log4j.CentralTaskLogAppender
activateOptions, close, getIsCleanup, getTaskId, getTotalLogFileSize, setFile, setIsCleanup, setTaskId, setTotalLogFileSizeMethods inherited from class com.mapr.log4j.MaprfsLogAppender
closeFile, createFile, failoverToLocalLogs, flush, getFile, getFileSize, getImmediateFlush, getImmediateSync, getSyncIntervalSeconds, hflush, hsync, requiresLayout, setFailoverAppender, setFS, setImmediateFlush, setImmediateSync, setSyncIntervalSeconds, setURI, sync, writeFooter, writeHeaderMethods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
-
Field Details
-
maxFileSize
protected long maxFileSizeThe default maximum file size is 10MB. -
maxBackupIndex
protected int maxBackupIndexThere is one backup file by default.
-
-
Constructor Details
-
YarnCentralTaskRollingLogAppender
public YarnCentralTaskRollingLogAppender()
-
-
Method Details
-
getFileSizeLimit
This method is overridden to disable the max event based log file truncation in CentralTaskLogAppender. The file size limit is taken care by this rolling appender.- Overrides:
getFileSizeLimitin classYarnCentralTaskLogAppender
-
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
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
public void append(org.apache.log4j.spi.LoggingEvent event) - Overrides:
appendin classCentralTaskLogAppender
-