public final class SLF4JBridgeHandler extends Handler
Bridge/route all JUL log records to the SLF4J API.
Implementation based on jul-to-slf4j bridge but at least 20% faster. Speed improvements come from using spf4j improved MessageFormatter + code cleanup. Also unlike jul-to-slf4j the sorce class and source method information is not being dropped.
Implementation is interchangeable with the jul-to-slf4j implementation
Constructor and Description |
---|
SLF4JBridgeHandler() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
static Method |
getSourceMethodInfo(LogRecord record) |
static void |
install()
Adds a SLF4JBridgeHandler instance to jul's root logger.
|
static boolean |
isInstalled()
Returns true if SLF4JBridgeHandler has been previously installed, returns false otherwise.
|
void |
publish(LogRecord record) |
static void |
removeHandlersForRootLogger()
Invoking this method removes/unregisters/detaches all handlers currently attached to the root logger
|
static void |
uninstall()
Removes previously installed SLF4JBridgeHandler instances.
|
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
public static void install()
public static void uninstall()
install()
.SecurityException
- A SecurityException
is thrown, if a security manager exists and if the
caller does not have LoggingPermission("control").public static boolean isInstalled()
SecurityException
public static void removeHandlersForRootLogger()
Copyright © 2018 SPF4J. All rights reserved.