|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.logger.LoggerBase
Convenience base class for Logger implementations. The only
method that must be implemented is log(String msg)
, plus
any property setting and lifecycle methods required for configuration.
Field Summary | |
protected Container |
container
The Container with which this Logger has been associated. |
protected javax.management.ObjectName |
controller
|
protected int |
debug
The debugging detail level for this component. |
protected java.lang.String |
domain
|
protected java.lang.String |
host
|
protected static java.lang.String |
info
The descriptive information about this implementation. |
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component. |
protected javax.management.MBeanServer |
mserver
|
protected javax.management.ObjectName |
oname
|
protected java.lang.String |
path
|
protected java.beans.PropertyChangeSupport |
support
The property change support for this component. |
protected int |
verbosity
The verbosity level for above which log messages may be filtered. |
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 | |
LoggerBase()
|
Method Summary | |
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component. |
javax.management.ObjectName |
createObjectName()
|
void |
destroy()
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
Container |
getContainer()
Return the Container with which this Logger has been associated. |
javax.management.ObjectName |
getController()
|
int |
getDebug()
Return the debugging detail level for this component. |
java.lang.String |
getDomain()
|
java.lang.String |
getInfo()
Return descriptive information about this Logger implementation and the corresponding version number, in the format <description>/<version> . |
javax.management.ObjectName |
getObjectName()
|
int |
getVerbosity()
Return the verbosity level of this logger. |
void |
init()
|
void |
log(java.lang.Exception exception,
java.lang.String msg)
Writes the specified exception, and message, to a servlet log file. |
void |
log(java.lang.String msg)
Writes the specified message to a servlet log file, usually an event log. |
void |
log(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. |
void |
log(java.lang.String msg,
java.lang.Throwable throwable)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file. |
void |
log(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. |
void |
postDeregister()
|
void |
postRegister(java.lang.Boolean registrationDone)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component. |
void |
setContainer(Container container)
Set the Container with which this Logger has been associated. |
void |
setController(javax.management.ObjectName controller)
|
void |
setDebug(int debug)
Set the debugging detail level for this component. |
void |
setVerbosity(int verbosity)
Set the verbosity level of this logger. |
void |
setVerbosityLevel(java.lang.String verbosity)
Set the verbosity level of this logger. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Container container
protected int debug
protected static final java.lang.String info
protected LifecycleSupport lifecycle
protected java.beans.PropertyChangeSupport support
protected int verbosity
protected java.lang.String domain
protected java.lang.String host
protected java.lang.String path
protected javax.management.ObjectName oname
protected javax.management.ObjectName controller
protected javax.management.MBeanServer mserver
Constructor Detail |
public LoggerBase()
Method Detail |
public Container getContainer()
getContainer
in interface Logger
public void setContainer(Container container)
setContainer
in interface Logger
container
- The associated Containerpublic int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic java.lang.String getInfo()
<description>/<version>
.
getInfo
in interface Logger
public int getVerbosity()
getVerbosity
in interface Logger
public void setVerbosity(int verbosity)
setVerbosity
in interface Logger
verbosity
- The new verbosity levelpublic void setVerbosityLevel(java.lang.String verbosity)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface Logger
listener
- The listener to addpublic void log(java.lang.String msg)
log
in interface Logger
msg
- A String
specifying the message to be
written to the log filepublic void log(java.lang.Exception exception, java.lang.String msg)
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.
log
in interface Logger
exception
- An Exception
to be reportedmsg
- The associated message stringpublic void log(java.lang.String msg, java.lang.Throwable throwable)
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.
log
in interface Logger
msg
- A String
that describes the error or
exceptionthrowable
- The Throwable
error or exceptionpublic void log(java.lang.String message, int verbosity)
log
in interface Logger
message
- A String
specifying the message to be
written to the log fileverbosity
- Verbosity level of this messagepublic void log(java.lang.String message, java.lang.Throwable throwable, int verbosity)
log
in interface Logger
message
- A String
that describes the error or
exceptionthrowable
- The Throwable
error or exceptionverbosity
- Verbosity level of this messagepublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Logger
listener
- The listener to removepublic javax.management.ObjectName getController()
public void setController(javax.management.ObjectName controller)
public javax.management.ObjectName getObjectName()
public java.lang.String getDomain()
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
preRegister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postRegister(java.lang.Boolean registrationDone)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister() throws java.lang.Exception
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
public void init()
public void destroy()
public javax.management.ObjectName createObjectName()
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic void start() throws LifecycleException
configure()
,
and before any of the public methods of the component are utilized.
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |