Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.

Field Summary

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, copyContext, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, 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`
  Parameters:
    `cm` - the server
    `ctx` - not null if this is a local interceptor
    `module` - 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`
  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`
  Throws:
    `TomcatException`

### addContext

    public void addContext(ContextManager cm,
                           Context ctx)
                    throws TomcatException

  Set default ServletLog for Context if necessary

  Overrides:
    `addContext` in class `BaseInterceptor`
  Throws:
    `TomcatException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.