Package com.sun.enterprise.web.logger
Class CatalinaLogger
- java.lang.Object
-
- com.sun.enterprise.web.logger.CatalinaLogger
-
-
Field Summary
Fields Modifier and Type Field Description protected ContainercontainerThe Container with which this Logger has been associated.protected static StringinfoThe descriptive information about this implementation.protected PropertyChangeSupportsupportThe property change support for this component.
-
Constructor Summary
Constructors Constructor Description CatalinaLogger(Logger logger)Construct a new instance of this class, that uses the specified logger instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)Add a property change listener to this component.ContainergetContainer()Return the Container with which this Logger has been associated.StringgetInfo()Return descriptive information about this Logger implementation and the corresponding version number, in the format<description>/<version>.intgetVerbosity()Logger interface method (ignored)voidlog(Exception exception, String msg)Writes the specified exception, and message, to a servlet log file.voidlog(String msg)Writes the specified message to a servlet log file, usually an event log.voidlog(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.voidlog(String msg, Throwable throwable)Writes an explanatory message and a stack trace for a givenThrowableexception to the servlet log file.voidlog(String message, 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.voidremovePropertyChangeListener(PropertyChangeListener listener)Remove a property change listener from this component.voidsetContainer(Container container)Set the Container with which this Logger has been associated.voidsetLevel(String logLevel)Set the verbosity level of this logger.voidsetVerbosity(int verbosity)Logger interface method (ignored)protected voidwrite(String msg, int verbosity)Logs the given message at the given verbosity level.protected voidwrite(String msg, Throwable throwable, int verbosity)
-
-
-
Field Detail
-
container
protected Container container
The Container with which this Logger has been associated.
-
info
protected static final String info
The descriptive information about this implementation.- See Also:
- Constant Field Values
-
support
protected PropertyChangeSupport support
The property change support for this component.
-
-
Constructor Detail
-
CatalinaLogger
public CatalinaLogger(Logger logger)
Construct a new instance of this class, that uses the specified logger instance.- Parameters:
logger- The logger to send log messages to
-
-
Method Detail
-
write
protected void write(String msg, int verbosity)
Logs the given message at the given verbosity level.
-
setLevel
public void setLevel(String logLevel)
Set the verbosity level of this logger. Messages logged with a higher verbosity than this level will be silently ignored.- Parameters:
logLevel- The new verbosity level, as a string
-
getContainer
public Container getContainer()
Return the Container with which this Logger has been associated.- Specified by:
getContainerin interfaceLogger
-
setContainer
public void setContainer(Container container)
Set the Container with which this Logger has been associated.- Specified by:
setContainerin interfaceLogger- Parameters:
container- The associated Container
-
getInfo
public String getInfo()
Return descriptive information about this Logger implementation and the corresponding version number, in the format<description>/<version>.
-
getVerbosity
public int getVerbosity()
Logger interface method (ignored)- Specified by:
getVerbosityin interfaceLogger
-
setVerbosity
public void setVerbosity(int verbosity)
Logger interface method (ignored)- Specified by:
setVerbosityin interfaceLogger- Parameters:
verbosity- The new verbosity level
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.- Specified by:
addPropertyChangeListenerin interfaceLogger- Parameters:
listener- The listener to add
-
log
public void log(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.
-
log
public void log(Exception exception, String msg)
Writes the specified exception, and message, to a servlet log file. The implementation of this method should calllog(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.
-
log
public void log(String msg, Throwable throwable)
Writes an explanatory message and a stack trace for a givenThrowableexception 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.
-
log
public void log(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.
-
log
public void log(String message, 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.
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.- Specified by:
removePropertyChangeListenerin interfaceLogger- Parameters:
listener- The listener to remove
-
-