|
jSyncManager Simple Java Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jSyncManager.SJS.LogManager
public class LogManager
A class for managing log files. This class will create a log file with the current date/time as the filename, with the specified file extension. When the log reaches a specified size (default of 2MB), a new log file will be created.
Constructor Summary | |
---|---|
LogManager(java.lang.String filePath,
java.lang.String fileExtension,
java.lang.String moduleName)
Creates a new Log Manager instance. |
|
LogManager(java.lang.String filePath,
java.lang.String fileExtension,
java.lang.String moduleName,
long maxSize)
Creates a new Log Manager instance. |
Method Summary | |
---|---|
void |
close()
Closes the log file. |
protected void |
finalize()
Finalizes the log file. |
void |
writeCriticalEntry(java.lang.String message)
Writes a critical information log entry to the log file. |
void |
writeExceptionEntry(java.lang.String message)
Writes an exception information log entry to the log file. |
void |
writeExceptionEntry(java.lang.Throwable exception)
Writes a throwable (exception/error) object to the log file. |
void |
writeGeneralEntry(java.lang.String message)
Writes a general information log entry to the log file. |
void |
writeWarningEntry(java.lang.String message)
Writes a warning information log entry to the log file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogManager(java.lang.String filePath, java.lang.String fileExtension, java.lang.String moduleName) throws java.io.IOException
filePath
- the path to write the log file to.fileExtension
- the extension to use for the filename.moduleName
- the name of the module to be logged.
java.io.IOException
- if an I/O exception occurs during construction.public LogManager(java.lang.String filePath, java.lang.String fileExtension, java.lang.String moduleName, long maxSize) throws java.io.IOException
filePath
- the path to write the log file to.fileExtension
- the extension to use for the filename.moduleName
- the name of the module to be logged.maxSize
- the maximum size that the log file can reach before creating a new log file.
java.io.IOException
- if an I/O excepttion occurs during construction.Method Detail |
---|
public void writeGeneralEntry(java.lang.String message)
message
- the message to be logged.public void writeCriticalEntry(java.lang.String message)
message
- the message to be logged.public void writeWarningEntry(java.lang.String message)
message
- the message to be logged.public void writeExceptionEntry(java.lang.String message)
message
- the message to be logged.public void writeExceptionEntry(java.lang.Throwable exception)
exception
- the throwable to be logged.public void close()
protected void finalize()
finalize
in class java.lang.Object
|
jSyncManager Simple Java Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |