FileDocCategorySizeDatePackage
Logger.javaAPI DocGlassfish v2 API6917Fri May 04 22:31:52 BST 2007org.apache.catalina

Logger

public interface Logger
A Logger is a generic interface for the message and exception logging methods of the ServletContext interface. Loggers can be attached at any Container level, but will typically only be attached to a Context, or higher level, Container.
author
Craig R. McClanahan
version
$Revision: 1.3 $ $Date: 2007/05/05 05:31:51 $

Fields Summary
public static final int
FATAL
Verbosity level constants for log messages that may be filtered by the underlying logger.
public static final int
ERROR
public static final int
WARNING
public static final int
INFORMATION
public static final int
DEBUG
Constructors Summary
Methods Summary
public voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.

param
listener The listener to add

public ContainergetContainer()
Return the Container with which this Logger has been associated.

public java.lang.StringgetInfo()
Return descriptive information about this Logger implementation and the corresponding version number, in the format <description>/<version>.

public intgetVerbosity()
Return the verbosity level of this logger. Messages logged with a higher verbosity than this level will be silently ignored.

public voidlog(java.lang.String message, int verbosity)
Writes the specified message to the servlet log file, usually an event log, if the logger is set to a verbosity level equal to or higher than the specified value for this message.

param
message A String specifying the message to be written to the log file
param
verbosity Verbosity level of this message

public voidlog(java.lang.String message, java.lang.Throwable throwable, int verbosity)
Writes the specified message and exception to the servlet log file, usually an event log, if the logger is set to a verbosity level equal to or higher than the specified value for this message.

param
message A String that describes the error or exception
param
throwable The Throwable error or exception
param
verbosity Verbosity level of this message

public voidlog(java.lang.String message)
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. This message will be logged unconditionally.

param
message A String specifying the message to be written to the log file

public voidlog(java.lang.Exception exception, java.lang.String msg)
Writes the specified exception, and message, to a servlet log file. The implementation of this method should call log(msg, exception) instead. This method is deprecated in the ServletContext interface, but not deprecated here to avoid many useless compiler warnings. This message will be logged unconditionally.

param
exception An Exception to be reported
param
msg The associated message string

public voidlog(java.lang.String message, java.lang.Throwable throwable)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file. The name and type of the servlet log file is specific to the servlet container, usually an event log. This message will be logged unconditionally.

param
message A String that describes the error or exception
param
throwable The Throwable error or exception

public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component.

param
listener The listener to remove

public voidsetContainer(Container container)
Set the Container with which this Logger has been associated.

param
container The associated Container

public voidsetVerbosity(int verbosity)
Set the verbosity level of this logger. Messages logged with a higher verbosity than this level will be silently ignored.

param
verbosity The new verbosity level