public class PatternProcessor extends Object
Constructor and Description |
---|
PatternProcessor(String pattern)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
formatFileName(StringBuilder buf,
boolean useCurrentTime,
Object obj)
Format file name.
|
protected void |
formatFileName(StringBuilder buf,
Object... objects)
Formats file name.
|
void |
formatFileName(StrSubstitutor subst,
StringBuilder buf,
boolean useCurrentTime,
Object obj)
Formats file name.
|
void |
formatFileName(StrSubstitutor subst,
StringBuilder buf,
Object obj)
Formats file name.
|
long |
getCurrentFileTime() |
RolloverFrequency |
getFrequency() |
long |
getNextFileTime() |
long |
getNextTime(long currentMillis,
int increment,
boolean modulus)
Returns the next potential rollover time.
|
String |
getPattern() |
long |
getPrevFileTime() |
void |
setCurrentFileTime(long currentFileTime) |
void |
setPrevFileTime(long prevFileTime) |
String |
toString() |
void |
updateTime() |
protected static final Logger LOGGER
public PatternProcessor(String pattern)
pattern
- The file pattern.public String getPattern()
public long getCurrentFileTime()
public void setCurrentFileTime(long currentFileTime)
public long getPrevFileTime()
public void setPrevFileTime(long prevFileTime)
public long getNextTime(long currentMillis, int increment, boolean modulus)
currentMillis
- 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.public void updateTime()
public final void formatFileName(StringBuilder buf, boolean useCurrentTime, Object obj)
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.public final void formatFileName(StrSubstitutor subst, StringBuilder buf, Object obj)
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.public final void formatFileName(StrSubstitutor subst, StringBuilder buf, boolean useCurrentTime, Object obj)
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.protected final void formatFileName(StringBuilder buf, Object... objects)
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.public RolloverFrequency getFrequency()
public long getNextFileTime()
Copyright © 1999-2017. 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.