Package helma.util
Class FileLogger
- java.lang.Object
-
- helma.util.Logger
-
- helma.util.FileLogger
-
- All Implemented Interfaces:
org.apache.commons.logging.Log
public class FileLogger extends Logger implements org.apache.commons.logging.Log
An extended Logger that writes to a file and rotates files each midnight.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileLogger(java.lang.String directory, java.lang.String name)
Create a file logger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
ensureOpen()
This is called by the runner thread to to make sure we have an open writer.java.lang.String
getName()
Return an object which identifies this logger.protected java.io.File
rotateLogFile()
Rotate log files, closing the file writer and renaming the old log file.java.lang.String
toString()
Return a string representation of this Logger-
Methods 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
-
-
-
-
Method Detail
-
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
protected java.io.File rotateLogFile() throws java.io.IOException
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:
java.io.IOException
- if an i/o error occurred
-
toString
public java.lang.String toString()
Return a string representation of this Logger
-
getName
public java.lang.String getName()
Return an object which identifies this logger.- Returns:
- the logger's name
-
-