本文整理匯總了Java中org.slf4j.bridge.SLF4JBridgeHandler.isInstalled方法的典型用法代碼示例。如果您正苦於以下問題:Java SLF4JBridgeHandler.isInstalled方法的具體用法?Java SLF4JBridgeHandler.isInstalled怎麽用?Java SLF4JBridgeHandler.isInstalled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.slf4j.bridge.SLF4JBridgeHandler
的用法示例。
在下文中一共展示了SLF4JBridgeHandler.isInstalled方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: installJulBridge
import org.slf4j.bridge.SLF4JBridgeHandler; //導入方法依賴的package包/類
private void installJulBridge() {
// Workaround for strange ClassCircularityErrors in the JUL bridge when very
// strange classloader hierarchies are
// set up and logging occurs from inside classloaders themselves (eg: some
// strange Tomcat deployments)
try {
Class.forName("java.util.logging.LogRecord");
} catch (ClassNotFoundException e) {
throw new AssertionError(e);
}
LoggerContext loggerContext = (LoggerContext) getContext();
if (!SLF4JBridgeHandler.isInstalled()) {
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
}
LevelChangePropagator julLevelChanger = new LevelChangePropagator();
julLevelChanger.setContext(loggerContext);
julLevelChanger.setResetJUL(true);
julLevelChanger.start();
loggerContext.addListener(julLevelChanger);
}
示例2: bridgeJulToSlf4j
import org.slf4j.bridge.SLF4JBridgeHandler; //導入方法依賴的package包/類
static void bridgeJulToSlf4j() {
if (!SLF4JBridgeHandler.isInstalled()) {
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
}
}
示例3: uninstallLogback
import org.slf4j.bridge.SLF4JBridgeHandler; //導入方法依賴的package包/類
public static void uninstallLogback() {
if (SLF4JBridgeHandler.isInstalled()) SLF4JBridgeHandler.uninstall();
}