public abstract class InternalLoggerFactory
extends java.lang.Object
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 InternalLoggerFactory |
defaultFactory |
| Constructor and Description |
|---|
InternalLoggerFactory() |
| Modifier and Type | Method and Description |
|---|---|
static InternalLoggerFactory |
getDefaultFactory()
Returns the default factory.
|
static InternalLogger |
getInstance(java.lang.Class<?> clazz)
Creates a new logger instance with the name of the specified class.
|
static InternalLogger |
getInstance(java.lang.String name)
Creates a new logger instance with the specified name.
|
private static InternalLoggerFactory |
newDefaultFactory(java.lang.String name) |
protected abstract InternalLogger |
newInstance(java.lang.String name)
Creates a new logger instance with the specified name.
|
static void |
setDefaultFactory(InternalLoggerFactory defaultFactory)
Changes the default factory.
|
private static volatile InternalLoggerFactory defaultFactory
private static InternalLoggerFactory newDefaultFactory(java.lang.String name)
public static InternalLoggerFactory getDefaultFactory()
JdkLoggerFactory.public static void setDefaultFactory(InternalLoggerFactory defaultFactory)
public static InternalLogger getInstance(java.lang.Class<?> clazz)
public static InternalLogger getInstance(java.lang.String name)
protected abstract InternalLogger newInstance(java.lang.String name)