public class YarnCentralTaskRollingLogAppender extends YarnCentralTaskLogAppender
YarnCentralTaskLogAppender#activateOptions. Since we cannot
inherit from 2 classes, and the code is fairly small, we did not refactor.| Modifier and Type | Field and Description |
|---|---|
protected int |
maxBackupIndex
There is one backup file by default.
|
protected long |
maxFileSize
The default maximum file size is 10MB.
|
BUFFER_SIZE, DIR_PREFIX, failoverAppender, failoverAppenderName, fileName, fileNamePath, immediateFlush, immediateSync, maprFS, nameHierarchy, syncIntervalSeconds, uri| Constructor and Description |
|---|
YarnCentralTaskRollingLogAppender() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(org.apache.log4j.spi.LoggingEvent event) |
protected java.lang.Long |
getFileSizeLimit()
This method is overridden to disable the max event based log file
truncation in CentralTaskLogAppender.
|
int |
getMaxBackupIndex()
Returns the value of the MaxBackupIndex option.
|
long |
getMaximumFileSize()
Get the maximum size that the output file is allowed to reach
before being rolled over to backup files.
|
void |
setMaxBackupIndex(int maxBackups)
Set the maximum number of backup files to keep around.
|
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.
|
void |
setMaximumFileSize(long maxFileSize)
Set the maximum size that the output file is allowed to reach
before being rolled over to backup files.
|
getFrameworkType, getLogFilePermissionactivateOptions, close, getIsCleanup, getTaskId, getTotalLogFileSize, setFile, setIsCleanup, setTaskId, setTotalLogFileSizecloseFile, createFile, failoverToLocalLogs, flush, getFile, getFileSize, getImmediateFlush, getImmediateSync, getSyncIntervalSeconds, hflush, hsync, requiresLayout, setFailoverAppender, setFS, setImmediateFlush, setImmediateSync, setSyncIntervalSeconds, setURI, sync, writeFooter, writeHeaderprotected long maxFileSize
protected int maxBackupIndex
protected java.lang.Long getFileSizeLimit()
getFileSizeLimit in class YarnCentralTaskLogAppenderpublic int getMaxBackupIndex()
public long getMaximumFileSize()
public void setMaxBackupIndex(int maxBackups)
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.
public void setMaximumFileSize(long maxFileSize)
This method is equivalent to setMaxFileSize(java.lang.String) except
that it is required for differentiating the setter taking a
long argument from the setter taking a
String argument by the JavaBeans Introspector.
setMaxFileSize(String)public void setMaxFileSize(java.lang.String value)
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.
public void append(org.apache.log4j.spi.LoggingEvent event)
append in class CentralTaskLogAppender