|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.log.AbstractRolloverLog
public class AbstractRolloverLog
Abstract class for a log that rolls over based on size or period.
| Field Summary | |
|---|---|
protected Path |
_path
|
protected java.lang.String |
_pathFormat
|
protected static L10N |
L
|
| Constructor Summary | |
|---|---|
AbstractRolloverLog()
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the log, flushing the results. |
protected void |
flush()
Writes to the underlying log. |
java.lang.String |
getArchiveFormat()
Sets the archive name format |
protected Path |
getArchivePath(long time)
Returns the name of the archived file |
protected java.lang.String |
getFormatName(java.lang.String format,
long time)
Returns the name of the archived file |
long |
getNextRolloverCheckTime()
|
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. |
void |
init()
Initialize the log. |
boolean |
isRollover()
|
boolean |
rollover()
|
protected void |
rolloverLog()
Check to see if we need to rollover the log. |
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. |
protected void |
write(byte[] buffer,
int offset,
int length)
Writes to the underlying log. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final L10N L
protected Path _path
protected java.lang.String _pathFormat
| Constructor Detail |
|---|
public AbstractRolloverLog()
| Method Detail |
|---|
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
ConfigExceptionpublic void setArchiveFormat(java.lang.String format)
public java.lang.String getArchiveFormat()
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 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)
public void init()
throws java.io.IOException
java.io.IOExceptionpublic long getNextRolloverCheckTime()
public boolean isRollover()
public boolean rollover()
protected void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
java.io.IOException
protected void flush()
throws java.io.IOException
java.io.IOExceptionprotected void rolloverLog()
now - current time in milliseconds.protected Path getPath(long time)
time - the archive dateprotected Path getArchivePath(long time)
time - the archive date
protected java.lang.String getFormatName(java.lang.String format,
long time)
time - the archive date
public void close()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||