org.apache.tomcat.modules.config
Class LogSetter

java.lang.Object
  |
  +--org.apache.tomcat.core.BaseInterceptor
        |
        +--org.apache.tomcat.modules.config.LogSetter

public class LogSetter
extends BaseInterceptor

Define a logger with the specified name, using the logger implementation in org.apache.tomcat.util.log.QueueLogger Tomcat uses the util.log.Log class - if you want to use a different logger ( like log4j or jsrXXX ) you need to create a new interceptor that will use your favorite logger and create a small adapter ( class extending Log and directing the output to your favorite logger. The only contract used in tomcat for logging is the util.Log.


Fields inherited from class org.apache.tomcat.core.BaseInterceptor
cm, ct, ctx, debug, DECLINED, loghelper, OK
 
Constructor Summary
LogSetter()
           
 
Method Summary
 void addContext(ContextManager cm, Context ctx)
          Set default ServletLog for Context if necessary
 void addInterceptor(ContextManager cm, Context ctx, BaseInterceptor module)
          The log will be added and opened as soon as the module is added to the server
 void engineInit(ContextManager cm)
          Initialize the module.
 void engineShutdown(ContextManager cm)
          Shut down the module.
 void setName(java.lang.String s)
          Set the name of the logger.
 void setPath(java.lang.String s)
           
 void setServletLogger(boolean b)
          This logger will be used for servlet's log.
 void setTimestampFormat(java.lang.String s)
          Set the format of the timestamp.
 void setTimestamps(boolean b)
          Display the time of the event ( log ).
 void setVerbosityLevel(java.lang.String s)
           
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addHandler, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextMap, contextShutdown, contextState, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogSetter

public LogSetter()
Method Detail

setName

public void setName(java.lang.String s)
Set the name of the logger. Predefined names are: tc_log, servlet_log, JASPER_LOG.

setPath

public void setPath(java.lang.String s)

setVerbosityLevel

public void setVerbosityLevel(java.lang.String s)

setServletLogger

public void setServletLogger(boolean b)
This logger will be used for servlet's log. ( if not set, the logger will output tomcat messages )

setTimestamps

public void setTimestamps(boolean b)
Display the time of the event ( log ).

setTimestampFormat

public void setTimestampFormat(java.lang.String s)
Set the format of the timestamp. "msec" will display the raw time ( fastest ), otherwise a SimpleDateFormat.

addInterceptor

public void addInterceptor(ContextManager cm,
                           Context ctx,
                           BaseInterceptor module)
                    throws TomcatException
The log will be added and opened as soon as the module is added to the server
Overrides:
addInterceptor in class BaseInterceptor
Following copied from class: org.apache.tomcat.core.BaseInterceptor
Parameters:
cm - the server
ctx - not null if this is a local interceptor
i - the new added interceptor
Throws:
TomcatException - The module will not be added if any module throws an exception.

engineInit

public void engineInit(ContextManager cm)
                throws TomcatException
Description copied from class: BaseInterceptor
Initialize the module.
Overrides:
engineInit in class BaseInterceptor
Following copied from class: org.apache.tomcat.core.BaseInterceptor
Throws:
TomcatException - The module will not be added if any exception is thrown by engineInit.

engineShutdown

public void engineShutdown(ContextManager cm)
                    throws TomcatException
Description copied from class: BaseInterceptor
Shut down the module.
Overrides:
engineShutdown in class BaseInterceptor
Following copied from class: org.apache.tomcat.core.BaseInterceptor
Throws:
If - any exception is reported, the module will be removed. XXX (?)

addContext

public void addContext(ContextManager cm,
                       Context ctx)
                throws TomcatException
Set default ServletLog for Context if necessary
Overrides:
addContext in class BaseInterceptor


Copyright © 2001 Apache Software Foundation. All Rights Reserved.