public class PatternProcessor extends Object
Constructor and Description |
---|
PatternProcessor(String pattern)
Constructor.
|
PatternProcessor(String pattern,
PatternProcessor copy)
Copy constructor with another pattern as source.
|
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() |
FileExtension |
getFileExtension() |
RolloverFrequency |
getFrequency() |
long |
getNextFileTime() |
long |
getNextTime(long currentMillis,
int increment,
boolean modulus)
Returns the next potential rollover time.
|
String |
getPattern() |
ArrayPatternConverter[] |
getPatternConverters() |
FormattingInfo[] |
getPatternFields() |
long |
getPrevFileTime() |
void |
setCurrentFileTime(long currentFileTime) |
void |
setPrevFileTime(long prevFileTime) |
void |
setTimeBased(boolean isTimeBased) |
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 FormattingInfo[] getPatternFields()
public ArrayPatternConverter[] getPatternConverters()
public void setTimeBased(boolean isTimeBased)
public long getCurrentFileTime()
public void setCurrentFileTime(long currentFileTime)
public long getPrevFileTime()
public void setPrevFileTime(long prevFileTime)
public FileExtension getFileExtension()
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-2023 The 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.