Packageorg.as3commons.logging
Classpublic class LoggerFactory
ImplementsILoggerFactory

Use the LoggerFactory to obtain a logger. This is the main class used when working with the as3commons-logging library.

You can either request a logger via the LoggerFactory.getClassLogger() or LoggerFactory.getLogger() methods.

When configuring a custom logger factory, make sure the logger factory is set before a logger is created. Here is an example (for your main application file):

// force the FlexLoggerFactory to be set before any loggers are created
  private static var loggerSetup:* = (LoggerFactory.loggerFactory = new FlexLoggerFactory());
  private static var logger:ILogger = LoggerFactory.getLogger("com.domain.MyClass");

By default, the DefaultLoggerFactory will be used that will write all log statements to the console using trace(). If you don't want any logging, set the logger factory to null.

// set the logger factory to null because we don't want to see any logging
  private static var loggerSetup:* = (LoggerFactory.loggerFactory = null);
  private static var logger:ILogger = LoggerFactory.getLogger("com.domain.MyClass");



Public Properties
 PropertyDefined by
  loggerFactory : ILoggerFactory
[static][write-only] Sets the logger factory for the logging system.
LoggerFactory
Public Methods
 MethodDefined by
  
Constructs a new LoggerFactory.
LoggerFactory
  
getClassLogger(clazz:Class):ILogger
[static] Returns a logger for the given class, using the fully qualified name of the class as the name of the logger.
LoggerFactory
  
getLogger(name:String):ILogger
[static] Returns a logger for the given name.
LoggerFactory
Property detail
loggerFactoryproperty
loggerFactory:ILoggerFactory  [write-only]

Sets the logger factory for the logging system.

Implementation
    public function set loggerFactory(value:ILoggerFactory):void
Constructor detail
LoggerFactory()constructor
public function LoggerFactory()

Constructs a new LoggerFactory.

Method detail
getClassLogger()method
public static function getClassLogger(clazz:Class):ILogger

Returns a logger for the given class, using the fully qualified name of the class as the name of the logger.

Parameters
clazz:Class

Returns
ILogger
getLogger()method 
public static function getLogger(name:String):ILogger

Returns a logger for the given name.

Parameters
name:String

Returns
ILogger