Top Description Fields Constructors Methods
org.mortbay.log

public Class Log

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, org.mortbay.util.Loader

Logging. This class provides a static logging interface. If an instance of the org.slf4j.Logger class is found on the classpath, the static log methods are directed to a slf4j logger for "org.mortbay.log". Otherwise the logs are directed to stderr. If the system property VERBOSE is set, then ignored exceptions are logged in detail.

Field Summary

Modifier and TypeField and Description
private static boolean
private static Logger
private static String
private static final String[]
private static final Class<T>[]
private static boolean
private static boolean
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public
Log()

Method Summary

Modifier and TypeMethod and Description
public static void
public static void
public static void
debug(String msg, Object arg)

public static void
debug(String msg, Object arg0, Object arg1)

public static Logger
public static Logger
getLogger(String name)

Obtain a named Logger.

public static void
ignore(Throwable th)

Ignore an exception unless trace is enabled.

public static void
info(String msg)

public static void
info(String msg, Object arg)

public static void
info(String msg, Object arg0, Object arg1)

public static boolean
public static boolean
public static void
public static void
setLogToParent(String
Logger name
name
)

Set Log to parent Logger.

private static void
public static void
warn(String msg)

public static void
warn(String msg, Object arg)

public static void
warn(String msg, Object arg0, Object arg1)

public static void
public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__ignoredback to summary
private static boolean __ignored
__logback to summary
private static Logger __log
__logClassback to summary
private static String __logClass
__nestedExback to summary
private static final String[] __nestedEx
__noArgsback to summary
private static final Class<T>[] __noArgs
__verboseback to summary
private static boolean __verbose
_initializedback to summary
private static boolean _initialized
EXCEPTIONback to summary
public static final String EXCEPTION
IGNOREDback to summary
public static final String IGNORED
IGNORED_FMTback to summary
public static final String IGNORED_FMT
NOT_IMPLEMENTEDback to summary
public static final String NOT_IMPLEMENTED

Constructor Detail

Logback to summary
public Log()

Method Detail

debugback to summary
public static void debug(Throwable th)
debugback to summary
public static void debug(String msg)
debugback to summary
public static void debug(String msg, Object arg)
debugback to summary
public static void debug(String msg, Object arg0, Object arg1)
getLogback to summary
public static Logger getLog()
getLoggerback to summary
public static Logger getLogger(String name)

Obtain a named Logger. Obtain a named Logger or the default Logger if null is passed.

ignoreback to summary
public static void ignore(Throwable th)

Ignore an exception unless trace is enabled. This works around the problem that log4j does not support the trace level.

infoback to summary
public static void info(String msg)
infoback to summary
public static void info(String msg, Object arg)
infoback to summary
public static void info(String msg, Object arg0, Object arg1)
initializedback to summary
public static boolean initialized()
isDebugEnabledback to summary
public static boolean isDebugEnabled()
setLogback to summary
public static void setLog(Logger log)
setLogToParentback to summary
public static void setLogToParent(String name)

Set Log to parent Logger.

If there is a different Log class available from a parent classloader, call getLogger(String) on it and construct a LoggerLog instance as this Log's Logger, so that logging is delegated to the parent Log.

This should be used if a webapp is using Log, but wishes the logging to be directed to the containers log.

If there is not parent Log, then this call is equivalent to

  Log.setLog(Log.getLogger(name));
Parameters
name:String

Logger name

unwindback to summary
private static void unwind(Throwable th)
warnback to summary
public static void warn(String msg)
warnback to summary
public static void warn(String msg, Object arg)
warnback to summary
public static void warn(String msg, Object arg0, Object arg1)
warnback to summary
public static void warn(String msg, Throwable th)
warnback to summary
public static void warn(Throwable th)