## org.mortbay.util.log4j
Class Log4jSink

    java.lang.Object
      |
      +--org.mortbay.util.log4j.Log4jSink

All Implemented Interfaces:
  LifeCycle, LogSink, java.io.Serializable

public class Log4jSink
extends java.lang.Object
implements LogSink

See Also:
  Serialized Form

Constructor Summary
`Log4jSink()`

Method Summary
`java.lang.String` `getOptions()`
`boolean` `isStarted()`
`void` `log(java.lang.String s)` Log a message.
`void` `log(java.lang.String tag, java.lang.Object msg, Frame frame, long time)` Log a message.
`void` `setOptions(java.lang.String filename)` Set the log options.
`void` `start()` Start the LifeCycle.
`void` `stop()` Stop the LifeCycle.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Log4jSink

    public Log4jSink()

Method Detail

### setOptions

    public void setOptions(java.lang.String filename)

  Description copied from interface: `LogSink`
  Set the log options.

  Specified by:
    `setOptions` in interface `LogSink`
  Parameters:
    `filename` - A string of characters as defined for the LOG_OPTIONS system parameter.

### getOptions

    public java.lang.String getOptions()

  Specified by:
    `getOptions` in interface `LogSink`

### start

    public void start()
               throws java.lang.Exception

  Description copied from interface: `LifeCycle`
  Start the LifeCycle.

  Specified by:
    `start` in interface `LifeCycle`
  Throws:
    `java.lang.Exception` - An arbitrary exception may be thrown.

### stop

    public void stop()

  Description copied from interface: `LifeCycle`
  Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

  Specified by:
    `stop` in interface `LifeCycle`

### isStarted

    public boolean isStarted()

  Specified by:
    `isStarted` in interface `LifeCycle`
  Returns:
    True if the LifeCycle has been started.

### log

    public void log(java.lang.String tag,
                    java.lang.Object msg,
                    Frame frame,
                    long time)

  Description copied from interface: `LogSink`
  Log a message. This method formats the log information as a string and calls log(String). It should only be specialized by a derived implementation if the format of the logged messages is to be changed.

  Specified by:
    `log` in interface `LogSink`
  Parameters:
    `tag` - Tag for type of log
    `msg` - The message
    `frame` - The frame that generated the message.
    `time` - The time stamp of the message.

### log

    public void log(java.lang.String s)

  Description copied from interface: `LogSink`
  Log a message. The formatted log string is written to the log sink. The default implementation writes the message to a PrintWriter.

  Specified by:
    `log` in interface `LogSink`
  Parameters:
    `s` -

Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.