|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.OutputStreamManager
org.apache.logging.log4j.core.appender.FastFileManager
public class FastFileManager
Extends OutputStreamManager but instead of using a buffered output stream,
this class uses a ByteBuffer
and a RandomAccessFile
to do the
I/O.
Field Summary |
---|
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
count, LOGGER |
Constructor Summary | |
---|---|
protected |
FastFileManager(RandomAccessFile file,
String fileName,
OutputStream os,
boolean immediateFlush,
String advertiseURI)
|
Method Summary | |
---|---|
void |
close()
|
void |
flush()
Flush any buffers. |
Map<String,String> |
getContentFormat()
FileManager's content format is specified by: Key: "fileURI" Value: provided "advertiseURI" param. |
static FastFileManager |
getFileManager(String fileName,
boolean append,
boolean isFlush,
String advertiseURI)
Returns the FastFileManager. |
String |
getFileName()
Returns the name of the File being managed. |
Boolean |
isEndOfBatch()
|
void |
setEndOfBatch(boolean isEndOfBatch)
|
protected void |
write(byte[] bytes,
int offset,
int length)
Some output streams synchronize writes while others do not. |
Methods inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager |
---|
getManager, getOutputStream, isOpen, releaseSub, setFooter, setHeader, setOutputStream, write |
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
getCount, getName, hasManager, release |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected FastFileManager(RandomAccessFile file, String fileName, OutputStream os, boolean immediateFlush, String advertiseURI)
Method Detail |
---|
public static FastFileManager getFileManager(String fileName, boolean append, boolean isFlush, String advertiseURI)
fileName
- The name of the file to manage.append
- true if the file should be appended to, false if it should
be overwritten.isFlush
- true if the contents should be flushed to disk on every
writeadvertiseURI
- the URI to use when advertising the file
public Boolean isEndOfBatch()
public void setEndOfBatch(boolean isEndOfBatch)
protected void write(byte[] bytes, int offset, int length)
OutputStreamManager
write
in class OutputStreamManager
bytes
- The serialized Log event.offset
- The offset into the byte array.length
- The number of bytes to write.public void flush()
OutputStreamManager
flush
in class OutputStreamManager
public void close()
close
in class OutputStreamManager
public String getFileName()
public Map<String,String> getContentFormat()
getContentFormat
in class AbstractManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2013 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.