Class Log
- java.lang.Object
-
- org.eclipse.jetty.util.log.Log
-
public class Log extends java.lang.Object
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.eclipse.log". Otherwise the logs are directed to stderr.The "org.eclipse.jetty.util.log.class" system property can be used to select a specific logging implementation.
If the system property org.eclipse.jetty.util.log.IGNORED is set, then ignored exceptions are logged in detail.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
__ignored
Legacy flag indicating ifLogger.ignore(Throwable)
methods produce any output in theLogger
sprivate static boolean
__initialized
static java.lang.String
__logClass
TheLogger
implementation class nameprivate static java.util.concurrent.ConcurrentMap<java.lang.String,Logger>
__loggers
protected static java.util.Properties
__props
Logging Configuration Propertiesstatic java.lang.String
EXCEPTION
static java.lang.String
IGNORED
private static Logger
LOG
-
Constructor Summary
Constructors Constructor Description Log()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Logger
getLog()
static Logger
getLogger(java.lang.Class<?> clazz)
Obtain a named Logger based on the fully qualified class name.static Logger
getLogger(java.lang.String name)
Obtain a named Logger or the default Logger if null is passed.static java.util.Map<java.lang.String,Logger>
getLoggers()
Get a map of all configuredLogger
instances.(package private) static java.util.concurrent.ConcurrentMap<java.lang.String,Logger>
getMutableLoggers()
static java.util.Properties
getProperties()
static Logger
getRootLogger()
Get the root logger.static void
initialized()
private static void
initStandardLogging(java.lang.Throwable e)
(package private) static boolean
isIgnored()
private static void
loadProperties(java.lang.String resourceName, java.util.Properties props)
static void
setLog(Logger log)
Set the root logger.static void
setLogToParent(java.lang.String name)
Set Log to parent Logger.
-
-
-
Field Detail
-
EXCEPTION
public static final java.lang.String EXCEPTION
- See Also:
- Constant Field Values
-
IGNORED
public static final java.lang.String IGNORED
- See Also:
- Constant Field Values
-
__logClass
public static java.lang.String __logClass
TheLogger
implementation class name
-
__ignored
public static boolean __ignored
Legacy flag indicating ifLogger.ignore(Throwable)
methods produce any output in theLogger
s
-
__props
protected static final java.util.Properties __props
Logging Configuration Properties
-
__loggers
private static final java.util.concurrent.ConcurrentMap<java.lang.String,Logger> __loggers
-
__initialized
private static boolean __initialized
-
LOG
private static Logger LOG
-
-
Method Detail
-
loadProperties
private static void loadProperties(java.lang.String resourceName, java.util.Properties props)
-
initialized
public static void initialized()
-
initStandardLogging
private static void initStandardLogging(java.lang.Throwable e)
-
getLog
public static Logger getLog()
-
setLog
public static void setLog(Logger log)
Set the root logger.Note that if any classes have statically obtained their logger instance prior to this call, their Logger will not be affected by this call.
- Parameters:
log
- the root logger implementation to set
-
getRootLogger
public static Logger getRootLogger()
Get the root logger.- Returns:
- the root logger
-
isIgnored
static boolean isIgnored()
-
setLogToParent
public static void setLogToParent(java.lang.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 aLoggerLog
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
- Logger name
-
getLogger
public static Logger getLogger(java.lang.Class<?> clazz)
Obtain a named Logger based on the fully qualified class name.- Parameters:
clazz
- the class to base the Logger name off of- Returns:
- the Logger with the given name
-
getLogger
public static Logger getLogger(java.lang.String name)
Obtain a named Logger or the default Logger if null is passed.- Parameters:
name
- the Logger name- Returns:
- the Logger with the given name
-
getMutableLoggers
static java.util.concurrent.ConcurrentMap<java.lang.String,Logger> getMutableLoggers()
-
getLoggers
@ManagedAttribute("list of all instantiated loggers") public static java.util.Map<java.lang.String,Logger> getLoggers()
Get a map of all configuredLogger
instances.- Returns:
- a map of all configured
Logger
instances
-
getProperties
public static java.util.Properties getProperties()
-
-