logahawk
Interface LoggerRegistry

All Known Implementing Classes:
HashLoggerRegistry, HierarchicalLoggerRegistry

public interface LoggerRegistry

Provides access to Loggers instances based on String keys or Class.getName(). This interface is similar to log4j's LogManager.getLogger() and Java Logging API's LogManager and implementations should function the same (or even wrap the aforementioned classes). One import difference is that this is an interface and all members are non-static -- that means you have the option of creating multiple LoggerRegistry classes and configuring & sharing them in application specific ways. This class is called "Registry" instead of "Factory" because the phrase "Factory" has different and incompatible meanings in existing logging frameworks. (Also "Registry" implies the ability to register Loggers at runtime, which Logahawk's HashLoggerRegistry and HierarchicalLoggerRegistry allow.)


Method Summary
 Logger get(Class clazz)
          Returns a Logger for the provided Class.
 Logger get(String key)
          Returns a Logger for the provided String.
 Logger getRootLogger()
          Returns the root (or default) Logger.
 

Method Detail

getRootLogger

Logger getRootLogger()
Returns the root (or default) Logger. The default is used when no Logger matches (String) .


get

Logger get(String key)
Returns a Logger for the provided String. If no specific Logger exists for the given String, the default Logger will be returned.


get

Logger get(Class clazz)
Returns a Logger for the provided Class. If no specific Logger exists for the given Class, the default Logger will be returned.