public class io.dropwizard.logging.LoggingUtil
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: io.dropwizard.logging.LoggingUtil
super_class: java.lang.Object
{
private static final io.dropwizard.util.Duration LOGGER_CONTEXT_AWAITING_TIMEOUT;
descriptor: Lio/dropwizard/util/Duration;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final io.dropwizard.util.Duration LOGGER_CONTEXT_AWAITING_SLEEP_TIME;
descriptor: Lio/dropwizard/util/Duration;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static boolean julHijacked;
descriptor: Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
RuntimeInvisibleAnnotations:
javax.annotation.concurrent.GuardedBy(value = "JUL_HIJACKING_LOCK")
private static final java.util.concurrent.locks.Lock JUL_HIJACKING_LOCK;
descriptor: Ljava/util/concurrent/locks/Lock;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: ldc 10
invokestatic io.dropwizard.util.Duration.seconds:(J)Lio/dropwizard/util/Duration;
putstatic io.dropwizard.logging.LoggingUtil.LOGGER_CONTEXT_AWAITING_TIMEOUT:Lio/dropwizard/util/Duration;
1: ldc 100
invokestatic io.dropwizard.util.Duration.milliseconds:(J)Lio/dropwizard/util/Duration;
putstatic io.dropwizard.logging.LoggingUtil.LOGGER_CONTEXT_AWAITING_SLEEP_TIME:Lio/dropwizard/util/Duration;
2: iconst_0
putstatic io.dropwizard.logging.LoggingUtil.julHijacked:Z
3: new java.util.concurrent.locks.ReentrantLock
dup
invokespecial java.util.concurrent.locks.ReentrantLock.<init>:()V
putstatic io.dropwizard.logging.LoggingUtil.JUL_HIJACKING_LOCK:Ljava/util/concurrent/locks/Lock;
return
LocalVariableTable:
Start End Slot Name Signature
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/dropwizard/logging/LoggingUtil;
public static ch.qos.logback.classic.LoggerContext getLoggerContext();
descriptor: ()Lch/qos/logback/classic/LoggerContext;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=0
0: invokestatic java.lang.System.nanoTime:()J
lstore 0
start local 0 1: StackMap locals: long
StackMap stack:
invokestatic org.slf4j.LoggerFactory.getILoggerFactory:()Lorg/slf4j/ILoggerFactory;
astore 2
start local 2 2: aload 2
instanceof ch.qos.logback.classic.LoggerContext
ifeq 4
3: aload 2
checkcast ch.qos.logback.classic.LoggerContext
areturn
4: StackMap locals: org.slf4j.ILoggerFactory
StackMap stack:
invokestatic java.lang.System.nanoTime:()J
lload 0
lsub
getstatic io.dropwizard.logging.LoggingUtil.LOGGER_CONTEXT_AWAITING_TIMEOUT:Lio/dropwizard/util/Duration;
invokevirtual io.dropwizard.util.Duration.toNanoseconds:()J
lcmp
ifle 6
5: new java.lang.IllegalStateException
dup
ldc "Unable to acquire the logger context"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals:
StackMap stack:
getstatic io.dropwizard.logging.LoggingUtil.LOGGER_CONTEXT_AWAITING_SLEEP_TIME:Lio/dropwizard/util/Duration;
invokevirtual io.dropwizard.util.Duration.toMilliseconds:()J
invokestatic java.lang.Thread.sleep:(J)V
7: goto 1
StackMap locals:
StackMap stack: java.lang.InterruptedException
8: astore 3
start local 3 9: new java.lang.IllegalStateException
dup
aload 3
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/Throwable;)V
athrow
end local 3 end local 2 end local 0 LocalVariableTable:
Start End Slot Name Signature
1 10 0 startTime J
2 10 2 iLoggerFactory Lorg/slf4j/ILoggerFactory;
9 10 3 e Ljava/lang/InterruptedException;
Exception table:
from to target type
6 7 8 Class java.lang.InterruptedException
public static void hijackJDKLogging();
descriptor: ()V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=0
0: getstatic io.dropwizard.logging.LoggingUtil.JUL_HIJACKING_LOCK:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.lock:()V
1: getstatic io.dropwizard.logging.LoggingUtil.julHijacked:Z
ifne 9
2: invokestatic org.slf4j.bridge.SLF4JBridgeHandler.removeHandlersForRootLogger:()V
3: invokestatic org.slf4j.bridge.SLF4JBridgeHandler.install:()V
4: iconst_1
putstatic io.dropwizard.logging.LoggingUtil.julHijacked:Z
5: goto 9
StackMap locals:
StackMap stack: java.lang.Throwable
6: astore 0
7: getstatic io.dropwizard.logging.LoggingUtil.JUL_HIJACKING_LOCK:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
8: aload 0
athrow
9: StackMap locals:
StackMap stack:
getstatic io.dropwizard.logging.LoggingUtil.JUL_HIJACKING_LOCK:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
10: return
LocalVariableTable:
Start End Slot Name Signature
Exception table:
from to target type
1 6 6 any
}
SourceFile: "LoggingUtil.java"