public class MaprfsRollingLogAppender extends MaprfsLogAppender
| 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 |
|---|
MaprfsRollingLogAppender() |
MaprfsRollingLogAppender(java.net.URI uri,
long maxSize,
int maxBackupIndex) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(org.apache.log4j.spi.LoggingEvent event) |
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.
|
activateOptions, close, closeFile, createFile, failoverToLocalLogs, flush, getFile, getFileSize, getImmediateFlush, getImmediateSync, getLogFilePermission, getSyncIntervalSeconds, hflush, hsync, requiresLayout, setFailoverAppender, setFile, setFS, setImmediateFlush, setImmediateSync, setSyncIntervalSeconds, setURI, sync, writeFooter, writeHeaderprotected long maxFileSize
protected int maxBackupIndex
public MaprfsRollingLogAppender()
public MaprfsRollingLogAppender(java.net.URI uri,
long maxSize,
int maxBackupIndex)
public 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.
protected void append(org.apache.log4j.spi.LoggingEvent event)
append in class MaprfsLogAppender