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_TYPEHELP_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, string2Vectorpublic 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 LogFileconfig - The property config store to find values injava.io.IOExceptionEBaseExceptionprotected void rl_init(int maxFileSize,
java.lang.String rolloverInterval,
java.lang.String expirationTime)
public void startup()
throws EBaseException
LogFile
startup in interface ILogEventListenerstartup in class LogFileEBaseException - if an internal error occurredpublic void shutdown()
shutdown in interface ILogEventListenershutdown in class LogFilepublic 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.IOExceptionpublic 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.ELogExceptionpublic void log(ILogEvent ev) throws ELogException
log in interface ILogEventListenerlog in class LogFileev - The event to be logged.ELogExceptionpublic NameValuePairs retrieveLogList(java.util.Hashtable req) throws javax.servlet.ServletException, java.io.IOException, EBaseException
retrieveLogList in interface ILogEventListenerretrieveLogList in class LogFilejavax.servlet.ServletExceptionjava.io.IOExceptionEBaseExceptionprotected java.lang.String[] fileList()
public java.lang.String getImplName()
ILogEventListenergetImplName in interface ILogEventListenergetImplName in class LogFilepublic java.lang.String getDescription()
ILogEventListenergetDescription in interface ILogEventListenergetDescription in class LogFilepublic java.util.Vector getDefaultParams()
ILogEventListenergetDefaultParams in interface ILogEventListenergetDefaultParams in class LogFilepublic java.util.Vector getInstanceParams()
ILogEventListenergetInstanceParams in interface ILogEventListenergetInstanceParams in class LogFilepublic java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
IExtendedPluginInfogetExtendedPluginInfo in interface IExtendedPluginInfogetExtendedPluginInfo in class LogFile