public class RollingFileManager extends FileManager
layout
count, LOGGER
Modifier | Constructor and Description |
---|---|
protected |
RollingFileManager(String fileName,
String pattern,
OutputStream os,
boolean append,
long size,
long time,
TriggeringPolicy triggeringPolicy,
RolloverStrategy rolloverStrategy,
String advertiseURI,
Layout<? extends Serializable> layout,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
checkRollover(LogEvent event)
Determine if a rollover should occur.
|
protected void |
createFileAfterRollover() |
static RollingFileManager |
getFileManager(String fileName,
String pattern,
boolean append,
boolean bufferedIO,
TriggeringPolicy policy,
RolloverStrategy strategy,
String advertiseURI,
Layout<? extends Serializable> layout,
int bufferSize)
Returns a RollingFileManager.
|
long |
getFileSize()
Returns the current size of the file.
|
long |
getFileTime()
Returns the time the file was created.
|
PatternProcessor |
getPatternProcessor()
Returns the pattern processor.
|
RolloverStrategy |
getRolloverStrategy()
Returns the rollover strategy
|
TriggeringPolicy |
getTriggeringPolicy()
Returns the triggering policy
|
protected void |
write(byte[] bytes,
int offset,
int length)
Some output streams synchronize writes while others do not.
|
getBufferSize, getContentFormat, getFileManager, getFileName, isAppend, isLocking
close, flush, getManager, getOutputStream, isOpen, releaseSub, setOutputStream, write, writeFooter
getCount, getName, hasManager, release
protected RollingFileManager(String fileName, String pattern, OutputStream os, boolean append, long size, long time, TriggeringPolicy triggeringPolicy, RolloverStrategy rolloverStrategy, String advertiseURI, Layout<? extends Serializable> layout, int bufferSize)
public static RollingFileManager getFileManager(String fileName, String pattern, boolean append, boolean bufferedIO, TriggeringPolicy policy, RolloverStrategy strategy, String advertiseURI, Layout<? extends Serializable> layout, int bufferSize)
fileName
- The file name.pattern
- The pattern for rolling file.append
- true if the file should be appended to.bufferedIO
- true if data should be buffered.policy
- The TriggeringPolicy.strategy
- The RolloverStrategy.advertiseURI
- the URI to use when advertising the filelayout
- The Layout.bufferSize
- buffer size to use if bufferedIO is trueprotected void write(byte[] bytes, int offset, int length)
OutputStreamManager
write
in class FileManager
bytes
- The serialized Log event.offset
- The offset into the byte array.length
- The number of bytes to write.public long getFileSize()
public long getFileTime()
public void checkRollover(LogEvent event)
event
- The LogEvent.protected void createFileAfterRollover() throws IOException
IOException
public PatternProcessor getPatternProcessor()
public TriggeringPolicy getTriggeringPolicy()
public RolloverStrategy getRolloverStrategy()
Copyright © 1999-2021 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.