public class RollingLogFile extends LogFile
Modifier and Type | Field and Description |
---|---|
protected long |
mExpirationTime
The amount of time before a backed up log is removed in milliseconds
|
protected int |
mMaxFileSize
The maximum file size in bytes
|
protected long |
mRolloverInterval
The amount of time in miniseconds between log rotations
|
static java.lang.String |
PROP_EXPIRATION_TIME |
static java.lang.String |
PROP_MAX_FILE_SIZE |
static java.lang.String |
PROP_ROLLOVER_INTERVAL |
mBufferSize, mBytesUnflushed, mBytesWritten, mConfig, mDate, mDatePattern, mFile, mFileName, mFlushInterval, mLevel, mLogDateFormat, mLogFileDateFormat, mLogSigning, mLogWriter, mOn, mPid, mRegister, mSelectedEvents, mSelectedEventsList, mSignedAuditLogger, mTrace, mType, PROP_LEVEL, PROP_ON, PROP_REGISTER, PROP_SIGNED_AUDIT_CERT_NICKNAME, PROP_SIGNED_AUDIT_EVENTS, PROP_SIGNED_AUDIT_LOG_SIGNING, PROP_TRACE, PROP_TYPE
HELP_TEXT, HELP_TOKEN
Constructor and Description |
---|
RollingLogFile()
Construct a RollingLogFile
|
Modifier and Type | Method and Description |
---|---|
long |
expire(long expirationSeconds)
Remove any log files which have not been modified in the specified
time
|
protected java.lang.String[] |
fileList()
Get the log file list in the log directory
|
java.util.Vector |
getDefaultParams()
Return list of default config parameters for this log event listener.
|
java.lang.String |
getDescription()
Returns the description of this log event listener.
|
int |
getExpirationTime()
Get the expiration time
|
java.lang.String[] |
getExtendedPluginInfo(java.util.Locale locale)
This method returns an array of strings.
|
java.lang.String |
getImplName()
Returns implementation name.
|
java.util.Vector |
getInstanceParams()
Return list of instance config parameters for this log event listener.
|
int |
getRolloverTime()
Get the rollover interval
|
void |
init(IConfigStore config)
Initialize and open a RollingLogFile using the prop config store
|
void |
log(ILogEvent ev)
Write an event to the log file
|
NameValuePairs |
retrieveLogList(java.util.Hashtable req)
Retrieve log file list.
|
protected void |
rl_init(int maxFileSize,
java.lang.String rolloverInterval,
java.lang.String expirationTime)
Convenience routine to initialized the RollingLogFile specific
attributes.
|
void |
rotate()
Rotate the log file to a backup file with a incrementing integer
extension
|
void |
setExpirationTime(java.lang.String expirationSeconds)
Set the file expiration time
|
void |
setRolloverTime(java.lang.String rolloverSeconds)
Set the rollover interval
|
void |
shutdown()
Shutdown this log file.
|
void |
startup()
Startup the instance
|
audit, base64Encode, close, deselectEvent, flush, getConfigStore, getLevel, getName, getOn, getType, init, init, log, logEvt2String, open, readEntry, replaceEvents, retrieveLogContent, selectEvent, setFlushInterval, string2Vector
public static final java.lang.String PROP_MAX_FILE_SIZE
public static final java.lang.String PROP_ROLLOVER_INTERVAL
public static final java.lang.String PROP_EXPIRATION_TIME
protected int mMaxFileSize
protected long mRolloverInterval
protected long mExpirationTime
public void init(IConfigStore config) throws java.io.IOException, EBaseException
init
in class LogFile
config
- The property config store to find values injava.io.IOException
EBaseException
protected void rl_init(int maxFileSize, java.lang.String rolloverInterval, java.lang.String expirationTime)
public void startup() throws EBaseException
LogFile
startup
in interface ILogEventListener
startup
in class LogFile
EBaseException
- if an internal error occurredpublic void shutdown()
shutdown
in interface ILogEventListener
shutdown
in class LogFile
public void setRolloverTime(java.lang.String rolloverSeconds)
rolloverSeconds
- The amount of time in seconds until the log
is rotated. A value of 0 will disable log rollover.public int getRolloverTime()
public void setExpirationTime(java.lang.String expirationSeconds)
expirationSeconds
- The amount of time in seconds until log files
are deletedpublic int getExpirationTime()
public void rotate() throws java.io.IOException
java.io.IOException
public long expire(long expirationSeconds) throws ELogException
NOTE: automatic removal of log files is currently NOT supported!
expirationSeconds
- The number of seconds since the expired files
have been modified.ELogException
public void log(ILogEvent ev) throws ELogException
log
in interface ILogEventListener
log
in class LogFile
ev
- The event to be logged.ELogException
public NameValuePairs retrieveLogList(java.util.Hashtable req) throws javax.servlet.ServletException, java.io.IOException, EBaseException
retrieveLogList
in interface ILogEventListener
retrieveLogList
in class LogFile
javax.servlet.ServletException
java.io.IOException
EBaseException
protected java.lang.String[] fileList()
public java.lang.String getImplName()
ILogEventListener
getImplName
in interface ILogEventListener
getImplName
in class LogFile
public java.lang.String getDescription()
ILogEventListener
getDescription
in interface ILogEventListener
getDescription
in class LogFile
public java.util.Vector getDefaultParams()
ILogEventListener
getDefaultParams
in interface ILogEventListener
getDefaultParams
in class LogFile
public java.util.Vector getInstanceParams()
ILogEventListener
getInstanceParams
in interface ILogEventListener
getInstanceParams
in class LogFile
public java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
IExtendedPluginInfo
getExtendedPluginInfo
in interface IExtendedPluginInfo
getExtendedPluginInfo
in class LogFile