org.jpos.util
Class RotateLogListener
java.lang.Object
org.jpos.util.SimpleLogListener
org.jpos.util.RotateLogListener
- All Implemented Interfaces:
- EventListener, Configurable, Destroyable, LogListener
- Direct Known Subclasses:
- DailyLogListener
public class RotateLogListener
- extends SimpleLogListener
- implements Configurable, Destroyable
Rotates logs
- Since:
- jPOS 1.2
- Version:
- $Revision$ $Date$
- Author:
- Alejandro P. Revilla
- See Also:
Configurable
| Methods inherited from class java.lang.Object |
clone, equals, finalize, 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(String logName,
int sleepTime,
int maxCopies,
long maxSize)
throws IOException
- Parameters:
name - base log filenamesleepTime - switch logs every t secondsmaxCopies - number of old logsmaxSize - in bytes
- Throws:
IOException
RotateLogListener
public RotateLogListener(String logName,
int sleepTime,
int maxCopies)
throws IOException
- Throws:
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
openLogFile
protected void openLogFile()
throws IOException
- Throws:
IOException
closeLogFile
protected void closeLogFile()
throws IOException
- Throws:
IOException
logRotate
public void logRotate()
throws IOException
- Throws:
IOException
logDebug
protected void logDebug(String msg)
checkSize
protected void checkSize()
destroy
public void destroy()
- Specified by:
destroy in interface Destroyable
Copyright © 1998-2012 jPOS.org. All Rights Reserved.