org.jpos.util
Class RotateLogListener
java.lang.Object
org.jpos.util.SimpleLogListener
org.jpos.util.RotateLogListener
- All Implemented Interfaces:
- java.util.EventListener, Configurable, Destroyable, LogListener
- Direct Known Subclasses:
- DailyLogListener
public class RotateLogListener
- extends SimpleLogListener
- implements Configurable, Destroyable
Rotates logs
- Since:
- jPOS 1.2
- Version:
- $Revision: 2594 $ $Date: 2008-01-22 08:41:31 -0800 (Tue, 22 Jan 2008) $
- Author:
- Alejandro P. Revilla
- See Also:
Configurable
|
Method Summary |
void |
destroy()
|
LogEvent |
log(LogEvent ev)
|
void |
logRotate()
|
void |
setConfiguration(Configuration cfg)
Configure this RotateLogListener
Properties:
file base log filename
[window] in seconds (default 0 - never rotate)
[count] number of copies (default 0 == single copy)
[maxsize] max log size in bytes (aprox)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CHECK_INTERVAL
public static final int CHECK_INTERVAL
- See Also:
- Constant Field Values
DEFAULT_MAXSIZE
public static final long DEFAULT_MAXSIZE
- See Also:
- Constant Field Values
RotateLogListener
public RotateLogListener(java.lang.String logName,
int sleepTime,
int maxCopies,
long maxSize)
throws java.io.IOException
- Parameters:
name - base log filenamesleepTime - switch logs every t secondsmaxCopies - number of old logsmaxSize - in bytes
- Throws:
java.io.IOException
RotateLogListener
public RotateLogListener(java.lang.String logName,
int sleepTime,
int maxCopies)
throws java.io.IOException
- Throws:
java.io.IOException
RotateLogListener
public RotateLogListener()
setConfiguration
public void setConfiguration(Configuration cfg)
throws ConfigurationException
- Configure this RotateLogListener
Properties:
- file base log filename
- [window] in seconds (default 0 - never rotate)
- [count] number of copies (default 0 == single copy)
- [maxsize] max log size in bytes (aprox)
- Specified by:
setConfiguration in interface Configurable
- Parameters:
cfg - Configuration
- Throws:
ConfigurationException
log
public LogEvent log(LogEvent ev)
- Specified by:
log in interface LogListener- Overrides:
log in class SimpleLogListener
logRotate
public void logRotate()
throws java.io.IOException
- Throws:
java.io.IOException
destroy
public void destroy()
- Specified by:
destroy in interface Destroyable