public class AbstractRolloverLog
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_pathFormat |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRolloverLog() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the log, flushing the results.
|
protected TempStreamApi |
createTempStream() |
protected void |
flush()
Writes to the underlying log.
|
protected void |
flushStream() |
java.lang.String |
getArchiveFormat()
Sets the archive name format
|
protected Path |
getArchivePath(long time)
Returns the name of the archived file
|
java.lang.String |
getArchiveSuffix() |
protected java.lang.String |
getFormatName(java.lang.String format,
long time)
Returns the name of the archived file
|
Path |
getPath()
Returns the access-log's path.
|
protected Path |
getPath(long time)
Returns the path of the format file
|
java.lang.String |
getPathFormat()
Returns the formatted path
|
Path |
getPwd()
Returns the pwd for the rollover log
|
long |
getRolloverCheckPeriod()
Sets how often the log rollover will be checked.
|
long |
getRolloverPeriod()
Sets the log rollover period, rounded up to the nearest hour.
|
long |
getRolloverSize()
Sets the log rollover size, rounded up to the megabyte.
|
protected long |
getTempStreamMax() |
void |
init()
Initialize the log.
|
protected boolean |
isClosed() |
boolean |
rollover() |
void |
setArchiveFormat(java.lang.String format)
Sets the archive name format
|
void |
setLastTime(long lastTime) |
void |
setPath(Path path)
Sets the access-log's path.
|
void |
setPathFormat(java.lang.String pathFormat)
Sets the formatted path.
|
void |
setRolloverCheckPeriod(long period)
Sets how often the log rollover will be checked.
|
void |
setRolloverCount(int count)
Sets the max rollover files.
|
void |
setRolloverCron(CronType cron)
Sets the log rollover cron specification
|
void |
setRolloverPeriod(Period period)
Sets the log rollover period, rounded up to the nearest hour.
|
void |
setRolloverSize(Bytes bytes)
Sets the log rollover size, rounded up to the megabyte.
|
void |
setRolloverSizeBytes(long size) |
java.lang.String |
toString() |
protected void |
write(byte[] buffer,
int offset,
int length)
Writes to the underlying log.
|
public Path getPath()
public void setPath(Path path)
public Path getPwd()
public java.lang.String getPathFormat()
public void setPathFormat(java.lang.String pathFormat) throws ConfigException
ConfigException
public void setArchiveFormat(java.lang.String format)
public java.lang.String getArchiveFormat()
public java.lang.String getArchiveSuffix()
public void setRolloverCron(CronType cron)
public void setRolloverPeriod(Period period)
period
- the new rollover period in milliseconds.public long getRolloverPeriod()
public void setRolloverSize(Bytes bytes)
bytes
- maximum size of the log filepublic void setRolloverSizeBytes(long size)
public long getRolloverSize()
public void setRolloverCheckPeriod(long period)
period
- how often the log rollover will be checked.public long getRolloverCheckPeriod()
public void setRolloverCount(int count)
public void setLastTime(long lastTime)
protected boolean isClosed()
public void init() throws java.io.IOException
java.io.IOException
public boolean rollover()
protected void write(byte[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
protected TempStreamApi createTempStream()
protected long getTempStreamMax()
protected void flush() throws java.io.IOException
java.io.IOException
protected void flushStream() throws java.io.IOException
java.io.IOException
protected Path getPath(long time)
time
- the archive dateprotected Path getArchivePath(long time)
time
- the archive dateprotected java.lang.String getFormatName(java.lang.String format, long time)
time
- the archive datepublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object