public abstract class AbstractLoggerFactory extends Object
ILogger 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, JdkLoggerFactory is used.
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,AbstractLoggerFactory.setDefaultFactory(JdkLoggerFactory.INSTANCE);
setDefaultFactory(AbstractLoggerFactory) should be called as early
as possible and shouldn't be called more than once.| 构造器和说明 |
|---|
AbstractLoggerFactory() |
| 限定符和类型 | 方法和说明 |
|---|---|
static AbstractLoggerFactory |
getDefaultFactory()
Returns the default factory.
|
static ILogger |
getInstance(Class<?> clazz)
Creates a new logger instance with the name of the specified class.
|
static ILogger |
getInstance(String name)
Creates a new logger instance with the specified name.
|
protected abstract ILogger |
newInstance(String name)
Creates a new logger instance with the specified name.
|
static void |
setDefaultFactory(AbstractLoggerFactory defaultFactory)
Changes the default factory.
|
public static AbstractLoggerFactory getDefaultFactory()
JdkLoggerFactory.public static void setDefaultFactory(AbstractLoggerFactory defaultFactory)
public static ILogger getInstance(Class<?> clazz)
public static ILogger getInstance(String name)
Copyright © 2022. All rights reserved.