org.mortbay.log

Class LogImpl

Implemented Interfaces:
org.apache.commons.logging.Log

public class LogImpl
extends java.lang.Object
implements org.apache.commons.logging.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 String
DEBUG
static String
ERROR
static String
FAIL
static String
INFO
static String
TRACE
static String
WARN
LogSink[]
_sinks

Constructor Summary

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

Method Summary

void
add(String logSinkClass)
Add a Log Sink.
void
add(LogSink logSink)
Add a Log Sink.
void
debug(Object m)
void
debug(Object m, Throwable ex)
void
deleteStoppedLogSinks()
void
error(Object arg0)
void
error(Object arg0, Throwable arg1)
void
fatal(Object arg0)
void
fatal(Object arg0, Throwable arg1)
boolean
getDebug()
Get the debug status.
String
getDebugPatterns()
Get the debug patterns.
LogSink[]
getLogSinks()
boolean
getSuppressWarnings()
Get the warnings suppression status.
int
getVerbose()
Get the verbosity level.
void
info(Object arg0)
void
info(Object arg0, Throwable arg1)
boolean
isDebugEnabled()
boolean
isErrorEnabled()
boolean
isFatalEnabled()
boolean
isInfoEnabled()
boolean
isTraceEnabled()
boolean
isWarnEnabled()
void
message(String tag, Object msg)
Log a message.
void
message(String tag, Object msg, int depth)
Log a message.
void
message(String tag, Object msg, Frame frame)
void
message(String tag, Object msg, Frame frame, long time)
Log a message.
void
reset()
No logging.
void
setDebug(boolean debug)
Set if debugging is on or off.
void
setDebugPatterns(String patterns)
Set debug patterns.
void
setSuppressWarnings(boolean warnings)
Set warning suppression.
void
setVerbose(int verbose)
Set verbosity level.
void
trace(Object arg0)
void
trace(Object arg0, Throwable arg1)
void
warn(Object arg0)
void
warn(Object arg0, Throwable arg1)

Field Details

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 Details

LogImpl

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

Method Details

add

public void add(String logSinkClass)
Add a Log Sink.
Parameters:
logSinkClass - The logsink classname or null for the default.

add

public void add(LogSink logSink)
            throws Exception
Add a Log Sink.
Parameters:
logSink -

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)
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

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.

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.