InternalLogger
or changes the default factory
implementation. This factory allows you to choose what logging framework
Netty should use. The default factory is Slf4JLoggerFactory
. If SLF4J
is not available, Log4JLoggerFactory
is used. If Log4J is not available,
JdkLoggerFactory
is used. You can change it to your preferred
logging framework before other Netty classes are loaded:
Please note that the new default factory is effective only for the classes which were loaded after the default factory is changed. Therefore,InternalLoggerFactory
.setDefaultFactory(Log4JLoggerFactory
.INSTANCE);
setDefaultFactory(InternalLoggerFactory)
should be called as early
as possible and shouldn't be called more than once.
Modifier and Type | Field and Description |
---|---|
private static volatile InternalLoggerFactory |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public static InternalLoggerFactory | |
public static InternalLogger | |
public static InternalLogger | |
private static InternalLoggerFactory | |
protected abstract InternalLogger | |
public static void | |
private static InternalLoggerFactory | |
private static InternalLoggerFactory | |
private static InternalLoggerFactory | |
private static InternalLoggerFactory |
defaultFactory | back to summary |
---|---|
private static volatile InternalLoggerFactory defaultFactory |
InternalLoggerFactory | back to summary |
---|---|
public InternalLoggerFactory() |
getDefaultFactory | back to summary |
---|---|
public static InternalLoggerFactory getDefaultFactory() Returns the default factory. The initial default factory is
|
getInstance | back to summary |
---|---|
public static InternalLogger getInstance(Class<?> clazz) Creates a new logger instance with the name of the specified class. |
getInstance | back to summary |
---|---|
public static InternalLogger getInstance(String name) Creates a new logger instance with the specified name. |
newDefaultFactory | back to summary |
---|---|
private static InternalLoggerFactory newDefaultFactory(String name)
|
newInstance | back to summary |
---|---|
protected abstract InternalLogger newInstance(String name) Creates a new logger instance with the specified name. |
setDefaultFactory | back to summary |
---|---|
public static void setDefaultFactory(InternalLoggerFactory defaultFactory) Changes the default factory. |
useJdkLoggerFactory | back to summary |
---|---|
private static InternalLoggerFactory useJdkLoggerFactory(String name) |
useLog4J2LoggerFactory | back to summary |
---|---|
private static InternalLoggerFactory useLog4J2LoggerFactory(String name) |
useLog4JLoggerFactory | back to summary |
---|---|
private static InternalLoggerFactory useLog4JLoggerFactory(String name) |
useSlf4JLoggerFactory | back to summary |
---|---|
private static InternalLoggerFactory useSlf4JLoggerFactory(String name) |