public class PatternProcessor extends Object
Constructor | Description |
---|---|
PatternProcessor(String pattern) |
Constructor.
|
PatternProcessor(String pattern,
PatternProcessor copy) |
Copy constructor with another pattern as source.
|
Modifier and Type | Method | 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 PatternProcessor(String pattern, PatternProcessor copy)
pattern
- The file pattern.copy
- Source pattern processorpublic 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-2018. 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.