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

java.lang.Object
  extended by org.apache.logging.log4j.core.appender.rolling.PatternProcessor

public class PatternProcessor
extends Object

Parse the rollover pattern.


Field Summary
protected static org.apache.logging.log4j.Logger LOGGER
           
 
Constructor Summary
PatternProcessor(String pattern)
          Constructor.
 
Method Summary
protected  void formatFileName(StringBuilder buf, Object... objects)
          Format file name.
 void formatFileName(StringBuilder buf, Object obj)
          Format file name.
 void formatFileName(StrSubstitutor subst, StringBuilder buf, Object obj)
          Format file name.
 long getNextTime(long current, int increment, boolean modulus)
          Returns the next potential rollover time.
 void updateTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.apache.logging.log4j.Logger LOGGER
Constructor Detail

PatternProcessor

public PatternProcessor(String pattern)
Constructor.

Parameters:
pattern - The file pattern.
Method Detail

getNextTime

public long getNextTime(long current,
                        int increment,
                        boolean modulus)
Returns the next potential rollover time.

Parameters:
current - The current time.
increment - The increment to the next time.
modulus - If true the time will be rounded to occur on a boundary aligned with the increment.
Returns:
the next potential rollover time and the timestamp for the target file.

updateTime

public void updateTime()

formatFileName

public final void formatFileName(StringBuilder buf,
                                 Object obj)
Format file name.

Parameters:
buf - string buffer to which formatted file name is appended, may not be null.
obj - object to be evaluated in formatting, may not be null.

formatFileName

public final void formatFileName(StrSubstitutor subst,
                                 StringBuilder buf,
                                 Object obj)
Format file name.

Parameters:
subst - The StrSubstitutor.
buf - string buffer to which formatted file name is appended, may not be null.
obj - object to be evaluated in formatting, may not be null.

formatFileName

protected final void formatFileName(StringBuilder buf,
                                    Object... objects)
Format file name.

Parameters:
buf - string buffer to which formatted file name is appended, may not be null.
objects - objects to be evaluated in formatting, may not be null.


Copyright © 1999-2015 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.