本文整理汇总了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();
}