|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.iperg.part.log.j2se.IpFileLogManager
public class IpFileLogManager
The file log manager will store log messages on files. There is a limit for how large a log file may become. If the current file used by the manager to log messages exceeds this size limit, the manager will allocate a new file and continue to write messages to this file instead. There is also a limit for how many log files the manager is allowed to allocate. If this limit is exceeded, the oldest log file is deleted when a new file is allocated.
For example, assume that the maximum number of log files is 3,
and that the log file name is 'partlog'. The following events will
then occur at various points in time (T1 < T2 < T3 ...)
Constructor Summary | |
---|---|
IpFileLogManager(java.lang.String applName)
Create a file log manager that will use default values for log file directory, name, size limit and max file count. |
|
IpFileLogManager(java.lang.String logFileDir,
java.lang.String logFileName,
int logFileSizeLimit,
int maxNrOfLogFiles,
java.lang.String applName)
Create a new file log manager. |
Method Summary | |
---|---|
java.lang.String |
getLogFileDirectory()
Get the directory in which log files are written. |
java.lang.String |
getLogFileName()
Get the file name used by the manager when creating log files. |
int |
getLogFileSizeLimit()
Get the current size limit of log files in kilobytes. |
int |
getMaxNrOfLogFiles()
Get the maximum number of log files that the manager can use when writing logs. |
void |
log(java.lang.String message)
Write a message to the log. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IpFileLogManager(java.lang.String logFileDir, java.lang.String logFileName, int logFileSizeLimit, int maxNrOfLogFiles, java.lang.String applName)
applName
parameter).
logFileDir
- Directory where log files will be placed. If
null
, the default directory will be used.logFileName
- The log file name. If null
, the
default file name will be used.logFileSizeLimit
- Max size of log file in kilobytes. If
<= 0, the default file size limit will be used.maxNrOfLogFiles
- Maximum number of log files that the
manager will create, must be >= 2. If < 2, the default maximum
number of log files will be used.applName
- A name that will be printed in the log file
header to ease identification when browsing files. May be
null
.public IpFileLogManager(java.lang.String applName)
applName
parameter).
./partlog
partlog
250
kilobyte
4
applName
- A name that will be printed in the log file
header to ease identification when browsing files. May be
null
.Method Detail |
---|
public java.lang.String getLogFileName()
public java.lang.String getLogFileDirectory()
public int getLogFileSizeLimit()
public int getMaxNrOfLogFiles()
getFileSizeLimit
method), the manager will create
a new file and continue logging messages on this file. This
behaviour will continue until the managers reaches the maximum
number of log files, which will cause the oldest existsing log
file to be removed.
public void log(java.lang.String message) throws java.io.IOException
TT:MM:SS - message
For example
12:04:58 - A game object was created
log
in interface IpLogManager
message
- The message to write to the log
java.io.IOException
- If an IO exception occurs while writing
the message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |