Package org.jboss.netty.logging
Class InternalLoggerFactory
- java.lang.Object
-
- org.jboss.netty.logging.InternalLoggerFactory
-
- Direct Known Subclasses:
CommonsLoggerFactory,JBossLoggerFactory,JdkLoggerFactory,Log4JLoggerFactory,OsgiLoggerFactory,Slf4JLoggerFactory
public abstract class InternalLoggerFactory extends java.lang.ObjectCreates anInternalLoggeror changes the default factory implementation. This factory allows you to choose what logging framework Netty should use. The default factory isJdkLoggerFactory. 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(newLog4JLoggerFactory());setDefaultFactory(InternalLoggerFactory)should be called as early as possible and shouldn't be called more than once.
-
-
Field Summary
Fields Modifier and Type Field Description private static InternalLoggerFactorydefaultFactory
-
Constructor Summary
Constructors Constructor Description InternalLoggerFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static InternalLoggerFactorygetDefaultFactory()Returns the default factory.static InternalLoggergetInstance(java.lang.Class<?> clazz)Creates a new logger instance with the name of the specified class.static InternalLoggergetInstance(java.lang.String name)Creates a new logger instance with the specified name.abstract InternalLoggernewInstance(java.lang.String name)Creates a new logger instance with the specified name.static voidsetDefaultFactory(InternalLoggerFactory defaultFactory)Changes the default factory.
-
-
-
Field Detail
-
defaultFactory
private static volatile InternalLoggerFactory defaultFactory
-
-
Method Detail
-
getDefaultFactory
public static InternalLoggerFactory getDefaultFactory()
Returns the default factory. The initial default factory isJdkLoggerFactory.
-
setDefaultFactory
public static void setDefaultFactory(InternalLoggerFactory defaultFactory)
Changes the default factory.
-
getInstance
public static InternalLogger getInstance(java.lang.Class<?> clazz)
Creates a new logger instance with the name of the specified class.
-
getInstance
public static InternalLogger getInstance(java.lang.String name)
Creates a new logger instance with the specified name.
-
newInstance
public abstract InternalLogger newInstance(java.lang.String name)
Creates a new logger instance with the specified name.
-
-