| Package | org.as3commons.logging |
| Class | public class LoggerFactory |
| Implements | ILoggerFactory |
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");| Property | Defined by | ||
|---|---|---|---|
| loggerFactory : ILoggerFactory
[static][write-only]
Sets the logger factory for the logging system.
| LoggerFactory | ||
| Method | Defined 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 | ||
|
[static]
Returns a logger for the given name.
| LoggerFactory | ||
| loggerFactory | property |
loggerFactory:ILoggerFactory [write-only]Sets the logger factory for the logging system.
Implementation public function set loggerFactory(value:ILoggerFactory):void
| LoggerFactory | () | constructor |
public function LoggerFactory()Constructs a new LoggerFactory.
| getClassLogger | () | method |
public static function getClassLogger(clazz:Class):ILoggerReturns a logger for the given class, using the fully qualified name of the class as the name of the logger.
Parametersclazz:Class |
ILogger |
| getLogger | () | method |
public static function getLogger(name:String):ILoggerReturns a logger for the given name.
Parametersname:String |
ILogger |