Inheritance diagram for Logger:
Public Member Functions | |
void | trace (char[] msg) |
void | info (char[] msg) |
void | warn (char[] msg) |
void | error (char[] msg) |
void | fatal (char[] msg) |
char[] | getName () |
Level | getLevel () |
void | setLevel (Level level) |
void | setLevel (Level level, bool force) |
bool | isEnabled (Level level) |
bool | isAdditive () |
void | setAdditive (bool enabled) |
void | clearAppenders () |
void | addAppender (Appender appender) |
ulong | getUptime () |
Static Public Member Functions | |
Logger | getRootLogger () |
Logger | getLogger (char[] name) |
Static Public Attributes | |
char[][] | LevelNames |
Private Types | |
enum | Level { Trace = 0, Info, Warn, Error, Fatal, None } |
Messages passed to a Logger are assumed to be pre-formatted. You may find that the TextFormat class is handy for collating various components of the message.
You may also need to use one of the two classes BasicConfigurator and PropertyConfigurator, along with the various Layout & Appender implementations to support your exact rendering needs.
Mango.log closely follows both the API and the behaviour as documented at the official Log4J site, where you'll find a good tutorial. Those pages are hosted over here.
Definition at line 79 of file Logger.d.
|
These represent the standard LOG4J event levels. Note that Debug is called Trace here, because debug is a reserved word in D (this needs to be fixed!). Definition at line 52 of file ILevel.d. Referenced by CacheServer::LoaderThread::load(), TaskServer::TaskConsumer::notify(), CacheInvalidatee::notify(), Hierarchy::propogate(), ClusterThread::run(), ClusterQueue::run(), and PropertyConfigurator::this(). |
|
Return the root Logger instance. This is the ancestor of all loggers and, as such, can be used to manipulate the entire hierarchy. For instance, setting the root 'level' attribute will affect all other loggers in the tree. Definition at line 93 of file Logger.d. Referenced by PropertyConfigurator::configure(), BasicConfigurator::defaultAppender(), and AdminServlet::setLoggerLevel(). |
|
Return an instance of the named logger. Names should be hierarchical in nature, using dot notation (with '.') to seperate each name section. For example, a typical name might be something like "mango.io.Buffer". If the logger does not currently exist, it is created and inserted into the hierarchy. A parent will be attached to it, which will be either the root logger or the closest ancestor in terms of the hierarchical name space. Definition at line 112 of file Logger.d. Referenced by PropertyConfigurator::configure(), main(), AdminServlet::setLoggerLevel(), ServletContext::this(), and AdminServlet::this(). |
|
Add a trace messages. This is called 'debug' in Log4J but that is a reserved word in the D language. This needs some more thought. Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by AdminServlet::service(). |
|
Add an info message Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by ServletContext::log(), main(), AdminServlet::setLoggerLevel(), and testHashMap(). |
|
Add a warning message Reimplemented from ILogger. Reimplemented in LoggerInstance. |
|
Add an error message Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by ServletContext::log(), and VersionMango::testRollingFileLog(). |
|
Add a fatal message Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by main(). |
|
Return the name of this Logger Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by AdminServlet::service(). |
|
Return the current level assigned to this logger Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by AdminServlet::service(). |
|
Set the activity level of this logger. Levels control how much information is emitted during runtime, and relate to each other as follows: Trace < Info < Warn < Error < Fatal < None That is, if the level is set to Error, only calls to the error() and fatal() methods will actually produce output: all others will be inhibited. Note that Log4J is a hierarchical environment, and each logger defaults to inheriting a level from its parent. Reimplemented from ILogger. Reimplemented in LoggerInstance. Referenced by AdminServlet::addLogger(), PropertyConfigurator::configure(), BasicConfigurator::configure(), and AdminServlet::setLoggerLevel(). |
|
same as setLevel (Level), but with additional control over whether the children are forced to accept the changed level or not. If 'force' is false, then children adopt the parent level only if they have their own level set to Level.None Reimplemented from ILogger. Reimplemented in LoggerInstance. |
|
Is this logger enabled for the provided level? Reimplemented from ILogger. Reimplemented in LoggerInstance. |
|
Return whether this logger uses additive appenders or not. See setAdditive(). Reimplemented from ILogger. Reimplemented in LoggerInstance. |
|
Specify whether or not this logger has additive behaviour. This is enabled by default, and causes a logger to invoke all appenders within its ancestry (until an ancestor is found with an additive attribute of false). Reimplemented from ILogger. Reimplemented in LoggerInstance. |
|
Remove all appenders from this logger. Reimplemented in LoggerInstance. |
|
Add an appender to this logger. You may add multiple appenders to appropriate loggers, and each of them will be invoked for that given logger, and for each of its child loggers (assuming isAdditive() is true for those children). Note that multiple instances of the same appender, regardless of where they may reside within the tree, are not invoked at runtime. That is, only one from a set of identical loggers will execute. Use clearAttributes() to remove all from a given logger. Reimplemented in LoggerInstance. Referenced by BasicConfigurator::defaultAppender(), and VersionMango::testRollingFileLog(). |
|
Get number of milliseconds since this application started Reimplemented from ILogger. Reimplemented in LoggerInstance. |
|
Initial value: ["TRACE " "INFO " "WARN " "ERROR " "FATAL " "NONE "] |