public class RollingRandomAccessFileManager extends RollingFileManager
ByteBuffer
and a RandomAccessFile
to do the
I/O.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size
|
layout
count, LOGGER
Constructor and Description |
---|
RollingRandomAccessFileManager(RandomAccessFile raf,
String fileName,
String pattern,
OutputStream os,
boolean append,
boolean immediateFlush,
int bufferSize,
long size,
long time,
TriggeringPolicy policy,
RolloverStrategy strategy,
String advertiseURI,
Layout<? extends Serializable> layout) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
createFileAfterRollover() |
void |
flush()
Flushes any buffers.
|
int |
getBufferSize()
Returns the buffer capacity.
|
static RollingRandomAccessFileManager |
getRollingRandomAccessFileManager(String fileName,
String filePattern,
boolean isAppend,
boolean immediateFlush,
int bufferSize,
TriggeringPolicy policy,
RolloverStrategy strategy,
String advertiseURI,
Layout<? extends Serializable> layout) |
Boolean |
isEndOfBatch() |
void |
setEndOfBatch(boolean isEndOfBatch) |
protected void |
write(byte[] bytes,
int offset,
int length)
Some output streams synchronize writes while others do not.
|
checkRollover, getFileManager, getFileSize, getFileTime, getPatternProcessor, getRolloverStrategy, getTriggeringPolicy
getContentFormat, getFileManager, getFileName, isAppend, isLocking
getManager, getOutputStream, isOpen, releaseSub, setOutputStream, write, writeFooter
getCount, getName, hasManager, release
public static final int DEFAULT_BUFFER_SIZE
public RollingRandomAccessFileManager(RandomAccessFile raf, String fileName, String pattern, OutputStream os, boolean append, boolean immediateFlush, int bufferSize, long size, long time, TriggeringPolicy policy, RolloverStrategy strategy, String advertiseURI, Layout<? extends Serializable> layout)
public static RollingRandomAccessFileManager getRollingRandomAccessFileManager(String fileName, String filePattern, boolean isAppend, boolean immediateFlush, int bufferSize, TriggeringPolicy policy, RolloverStrategy strategy, String advertiseURI, Layout<? extends Serializable> layout)
public Boolean isEndOfBatch()
public void setEndOfBatch(boolean isEndOfBatch)
protected void write(byte[] bytes, int offset, int length)
OutputStreamManager
write
in class RollingFileManager
bytes
- The serialized Log event.offset
- The offset into the byte array.length
- The number of bytes to write.protected void createFileAfterRollover() throws IOException
createFileAfterRollover
in class RollingFileManager
IOException
public void flush()
OutputStreamManager
flush
in class OutputStreamManager
public void close()
close
in class OutputStreamManager
public int getBufferSize()
getBufferSize
in class FileManager
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.