org.apache.catalina.logger
Class FileLogger

java.lang.Object
  extended byorg.apache.catalina.logger.LoggerBase
      extended byorg.apache.catalina.logger.FileLogger
All Implemented Interfaces:
Lifecycle, Logger, javax.management.MBeanRegistration

public class FileLogger
extends LoggerBase

Implementation of Logger that appends log messages to a file named {prefix}.{date}.{suffix} in a configured directory, with an optional preceding timestamp.

Version:
$Revision: 1.4 $ $Date: 2004/02/27 14:58:44 $
Author:
Craig R. McClanahan

Field Summary
protected static java.lang.String info
          The descriptive information about this implementation.
 
Fields inherited from class org.apache.catalina.logger.LoggerBase
container, controller, debug, domain, host, lifecycle, mserver, oname, path, support, verbosity
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, START_EVENT, STOP_EVENT
 
Fields inherited from interface org.apache.catalina.Logger
DEBUG, ERROR, FATAL, INFORMATION, WARNING
 
Constructor Summary
FileLogger()
           
 
Method Summary
 java.lang.String getDirectory()
          Return the directory in which we create log files.
 java.lang.String getPrefix()
          Return the log file prefix.
 java.lang.String getSuffix()
          Return the log file suffix.
 boolean getTimestamp()
          Return the timestamp flag.
 void log(java.lang.String msg)
          Writes the specified message to a servlet log file, usually an event log.
 void setDirectory(java.lang.String directory)
          Set the directory in which we create log files.
 void setPrefix(java.lang.String prefix)
          Set the log file prefix.
 void setSuffix(java.lang.String suffix)
          Set the log file suffix.
 void setTimestamp(boolean timestamp)
          Set the timestamp flag.
 void start()
          Prepare for the beginning of active use of the public methods of this component.
 void stop()
          Gracefully terminate the active use of the public methods of this component.
 
Methods inherited from class org.apache.catalina.logger.LoggerBase
addLifecycleListener, addPropertyChangeListener, createObjectName, destroy, findLifecycleListeners, getContainer, getController, getDebug, getDomain, getInfo, getObjectName, getVerbosity, init, log, log, log, log, postDeregister, postRegister, preDeregister, preRegister, removeLifecycleListener, removePropertyChangeListener, setContainer, setController, setDebug, setVerbosity, setVerbosityLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected static final java.lang.String info
The descriptive information about this implementation.

See Also:
Constant Field Values
Constructor Detail

FileLogger

public FileLogger()
Method Detail

getDirectory

public java.lang.String getDirectory()
Return the directory in which we create log files.


setDirectory

public void setDirectory(java.lang.String directory)
Set the directory in which we create log files.

Parameters:
directory - The new log file directory

getPrefix

public java.lang.String getPrefix()
Return the log file prefix.


setPrefix

public void setPrefix(java.lang.String prefix)
Set the log file prefix.

Parameters:
prefix - The new log file prefix

getSuffix

public java.lang.String getSuffix()
Return the log file suffix.


setSuffix

public void setSuffix(java.lang.String suffix)
Set the log file suffix.

Parameters:
suffix - The new log file suffix

getTimestamp

public boolean getTimestamp()
Return the timestamp flag.


setTimestamp

public void setTimestamp(boolean timestamp)
Set the timestamp flag.

Parameters:
timestamp - The new timestamp flag

log

public void log(java.lang.String msg)
Writes the specified message to a servlet log file, usually an event log. The name and type of the servlet log is specific to the servlet container.

Specified by:
log in interface Logger
Overrides:
log in class LoggerBase
Parameters:
msg - A String specifying the message to be written to the log file

start

public void start()
           throws LifecycleException
Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.

Specified by:
start in interface Lifecycle
Overrides:
start in class LoggerBase
Throws:
LifecycleException - if this component detects a fatal error that prevents this component from being used

stop

public void stop()
          throws LifecycleException
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.

Specified by:
stop in interface Lifecycle
Overrides:
stop in class LoggerBase
Throws:
LifecycleException - if this component detects a fatal error that needs to be reported


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.