org.apache.logging.log4j.core.appender.rolling
Class RollingFileManager

java.lang.Object
  extended by org.apache.logging.log4j.core.appender.AbstractManager
      extended by org.apache.logging.log4j.core.appender.OutputStreamManager
          extended by org.apache.logging.log4j.core.appender.FileManager
              extended by org.apache.logging.log4j.core.appender.rolling.RollingFileManager

public class RollingFileManager
extends FileManager

The Rolling File Manager.


Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
 
Constructor Summary
protected RollingFileManager(String fileName, String pattern, OutputStream os, boolean append, long size, long time, TriggeringPolicy policy, RolloverStrategy strategy)
           
 
Method Summary
 void checkRollover(LogEvent event)
          Determine if a rollover should occur.
static RollingFileManager getFileManager(String fileName, String pattern, boolean append, boolean bufferedIO, TriggeringPolicy policy, RolloverStrategy strategy)
          Returns a RollingFileManager.
 long getFileSize()
          Returns the current size of the file.
 long getFileTime()
          Returns the time the file was created.
 PatternProcessor getProcessor()
          Returns the pattern processor.
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.FileManager
getFileManager, getFileName, isAppend, isLocking
 
Methods inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
close, flush, 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

RollingFileManager

protected RollingFileManager(String fileName,
                             String pattern,
                             OutputStream os,
                             boolean append,
                             long size,
                             long time,
                             TriggeringPolicy policy,
                             RolloverStrategy strategy)
Method Detail

getFileManager

public static RollingFileManager getFileManager(String fileName,
                                                String pattern,
                                                boolean append,
                                                boolean bufferedIO,
                                                TriggeringPolicy policy,
                                                RolloverStrategy strategy)
Returns a RollingFileManager.

Parameters:
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.
Returns:
A RollingFileManager.

write

protected void write(byte[] bytes,
                     int offset,
                     int length)
Description copied from class: OutputStreamManager
Some output streams synchronize writes while others do not. Synchronizing here insures that log events won't be intertwined.

Overrides:
write in class FileManager
Parameters:
bytes - The serialized Log event.
offset - The offset into the byte array.
length - The number of bytes to write.

getFileSize

public long getFileSize()
Returns the current size of the file.

Returns:
The size of the file in bytes.

getFileTime

public long getFileTime()
Returns the time the file was created.

Returns:
The time the file was created.

checkRollover

public void checkRollover(LogEvent event)
Determine if a rollover should occur.

Parameters:
event - The LogEvent.

getProcessor

public PatternProcessor getProcessor()
Returns the pattern processor.

Returns:
The PatternProcessor.


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.