org.jboss.netty.logging
Class InternalLoggerFactory

java.lang.Object
  extended by org.jboss.netty.logging.InternalLoggerFactory
Direct Known Subclasses:
CommonsLoggerFactory, JBossLoggerFactory, JdkLoggerFactory, Log4JLoggerFactory, OsgiLoggerFactory, Slf4JLoggerFactory

public abstract class InternalLoggerFactory
extends Object

Creates an InternalLogger or changes the default factory implementation. This factory allows you to choose what logging framework Netty should use. The default factory is JdkLoggerFactory. You can change it to your preferred logging framework before other Netty classes are loaded:

 InternalLoggerFactory.setDefaultFactory(new Log4JLoggerFactory());
 
Please note that the new default factory is effective only for the classes which were loaded after the default factory is changed. Therefore, setDefaultFactory(InternalLoggerFactory) should be called as early as possible and shouldn't be called more than once.

Version:
$Rev: 2122 $, $Date: 2010-02-02 11:00:04 +0900 (Tue, 02 Feb 2010) $
Author:
The Netty Project, Trustin Lee

Constructor Summary
InternalLoggerFactory()
           
 
Method Summary
static InternalLoggerFactory getDefaultFactory()
          Returns the default factory.
static InternalLogger getInstance(Class<?> clazz)
          Creates a new logger instance with the name of the specified class.
static InternalLogger getInstance(String name)
          Creates a new logger instance with the specified name.
abstract  InternalLogger newInstance(String name)
          Creates a new logger instance with the specified name.
static void setDefaultFactory(InternalLoggerFactory defaultFactory)
          Changes the default factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalLoggerFactory

public InternalLoggerFactory()
Method Detail

getDefaultFactory

public static InternalLoggerFactory getDefaultFactory()
Returns the default factory. The initial default factory is JdkLoggerFactory.


setDefaultFactory

public static void setDefaultFactory(InternalLoggerFactory defaultFactory)
Changes the default factory.


getInstance

public static InternalLogger getInstance(Class<?> clazz)
Creates a new logger instance with the name of the specified class.


getInstance

public static InternalLogger getInstance(String name)
Creates a new logger instance with the specified name.


newInstance

public abstract InternalLogger newInstance(String name)
Creates a new logger instance with the specified name.



Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.