Package helma.util
Class FileLogger
java.lang.Object
helma.util.Logger
helma.util.FileLogger
- All Implemented Interfaces:
org.apache.commons.logging.Log
An extended Logger that writes to a file and rotates files each midnight.
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FileLogger
(String directory, String name) Create a file logger. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This is called by the runner thread to to make sure we have an open writer.getName()
Return an object which identifies this logger.protected File
Rotate log files, closing the file writer and renaming the old log file.toString()
Return a string representation of this LoggerMethods inherited from class helma.util.Logger
debug, debug, error, error, fatal, fatal, getCanonicalName, getLogLevel, getSedatedLog, getStackTrace, info, info, isDebugEnabled, isErrorEnabled, isFatalEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, log, renderDate, setLogLevel, trace, trace, warn, warn, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.logging.Log
debug, debug, error, error, fatal, fatal, info, info, isDebugEnabled, isErrorEnabled, isFatalEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, warn, warn
-
Constructor Details
-
FileLogger
Create a file logger. The actual file names do have numbers appended and are rotated every x bytes.- Parameters:
directory
- the directoryname
- the log file base name
-
-
Method Details
-
ensureOpen
protected void ensureOpen()This is called by the runner thread to to make sure we have an open writer.- Overrides:
ensureOpen
in classLogger
-
rotateLogFile
Rotate log files, closing the file writer and renaming the old log file. Returns the renamed log file for zipping, or null if the log file couldn't be rotated.- Returns:
- the old renamed log file, or null
- Throws:
IOException
- if an i/o error occurred
-
toString
Return a string representation of this Logger -
getName
Return an object which identifies this logger.- Returns:
- the logger's name
-