org.mortbay.log

Class LogImpl

public class LogImpl extends Object implements Log

A Commons Log implementation for Jetty logs. The log can contain multiple log syncs. The following system properties can be used to control the configuration:
   DEBUG - if set debugging is output is enabled.
   DEBUG_PATTERNS - A list of substring patterns used to match against log information for
                    fine grained control of debug logging.
   DEBUG_VERBOSE - If set to a positive integer, trace and info are enabled.
                   If set to zero, then info is enabled.
   LOG_SINKS - List of class names used to instantiate the log sinks.
 
This logger can be configured with the org.mortbay.log.Factory

See Also: LogFactory

Field Summary
static StringDEBUG
static StringERROR
static StringFAIL
static StringINFO
static StringTRACE
static StringWARN
LogSink[]_sinks
Constructor Summary
LogImpl()
Construct the shared instance of Log that decodes the options setup in the environments properties.
Method Summary
voidadd(LogSink logSink)
Add a Log Sink.
voidadd(String logSinkClass)
Add a Log Sink.
voiddebug(Object m)
voiddebug(Object m, Throwable ex)
voiddeleteStoppedLogSinks()
voiderror(Object arg0)
voiderror(Object arg0, Throwable arg1)
voidfatal(Object arg0)
voidfatal(Object arg0, Throwable arg1)
booleangetDebug()
Get the debug status.
StringgetDebugPatterns()
Get the debug patterns.
LogSink[]getLogSinks()
booleangetSuppressWarnings()
Get the warnings suppression status.
intgetVerbose()
Get the verbosity level.
voidinfo(Object arg0)
voidinfo(Object arg0, Throwable arg1)
booleanisDebugEnabled()
booleanisErrorEnabled()
booleanisFatalEnabled()
booleanisInfoEnabled()
booleanisTraceEnabled()
booleanisWarnEnabled()
voidmessage(String tag, Object msg, Frame frame)
voidmessage(String tag, Object msg, Frame frame, long time)
Log a message.
voidmessage(String tag, Object msg)
Log a message.
voidmessage(String tag, Object msg, int depth)
Log a message.
voidreset()
No logging.
voidsetDebug(boolean debug)
Set if debugging is on or off.
voidsetDebugPatterns(String patterns)
Set debug patterns.
voidsetSuppressWarnings(boolean warnings)
Set warning suppression.
voidsetVerbose(int verbose)
Set verbosity level.
voidtrace(Object arg0)
voidtrace(Object arg0, Throwable arg1)
voidwarn(Object arg0)
voidwarn(Object arg0, Throwable arg1)

Field Detail

DEBUG

public static final String DEBUG

ERROR

public static final String ERROR

FAIL

public static final String FAIL

INFO

public static final String INFO

TRACE

public static final String TRACE

WARN

public static final String WARN

_sinks

public LogSink[] _sinks

Constructor Detail

LogImpl

public LogImpl()
Construct the shared instance of Log that decodes the options setup in the environments properties.

Method Detail

add

public void add(LogSink logSink)
Add a Log Sink.

Parameters: logSink

add

public void add(String logSinkClass)
Add a Log Sink.

Parameters: logSinkClass The logsink classname or null for the default.

debug

public void debug(Object m)

debug

public void debug(Object m, Throwable ex)

deleteStoppedLogSinks

public void deleteStoppedLogSinks()

error

public void error(Object arg0)

error

public void error(Object arg0, Throwable arg1)

fatal

public void fatal(Object arg0)

fatal

public void fatal(Object arg0, Throwable arg1)

getDebug

public boolean getDebug()
Get the debug status.

Returns: the debug status

getDebugPatterns

public String getDebugPatterns()
Get the debug patterns.

Returns: Coma separated list of debug patterns

getLogSinks

public LogSink[] getLogSinks()

getSuppressWarnings

public boolean getSuppressWarnings()
Get the warnings suppression status.

Returns: the warnings suppression status

getVerbose

public int getVerbose()
Get the verbosity level.

Returns: the verbosity level

info

public void info(Object arg0)

info

public void info(Object arg0, Throwable arg1)

isDebugEnabled

public boolean isDebugEnabled()

isErrorEnabled

public boolean isErrorEnabled()

isFatalEnabled

public boolean isFatalEnabled()

isInfoEnabled

public boolean isInfoEnabled()

isTraceEnabled

public boolean isTraceEnabled()

isWarnEnabled

public boolean isWarnEnabled()

message

public void message(String tag, Object msg, Frame frame)

message

public void message(String tag, Object msg, Frame frame, long time)
Log a message.

Parameters: tag Tag for type of log msg The message frame The frame that generated the message. time The time stamp of the message.

message

public void message(String tag, Object msg)
Log a message.

Parameters: tag Tag for type of log msg The message

message

public void message(String tag, Object msg, int depth)
Log a message.

Parameters: tag Tag for type of log msg The message

reset

public void reset()
No logging. All log sinks are stopped and removed.

setDebug

public void setDebug(boolean debug)
Set if debugging is on or off.

Parameters: debug

setDebugPatterns

public void setDebugPatterns(String patterns)
Set debug patterns.

Parameters: patterns comma separated string of patterns

setSuppressWarnings

public void setSuppressWarnings(boolean warnings)
Set warning suppression.

Parameters: warnings Warnings suppress if this is true and debug is false

setVerbose

public void setVerbose(int verbose)
Set verbosity level.

Parameters: verbose

trace

public void trace(Object arg0)

trace

public void trace(Object arg0, Throwable arg1)

warn

public void warn(Object arg0)

warn

public void warn(Object arg0, Throwable arg1)
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.