Each logger instance firstly maintains a list of registered destinations, i.e. all output places for log messages. Moreover, it provides mapping of destination names to destination instance pointers (destination mapping table). Note that destination name is not a property of destination class.
Next, the logger has a table of rules. A rule is a filter that helps to determine whether each particular message should be sent to each of a specific set of destinations (each message has attributes such as priority, type, facility - i.e. particular part of the Core and status, which bears the information carried in the message). Each rule consists of selector and rule destinations iterators set. Selector works as a predicate - its parameters are the attributes of a log message. If it, applied to a log message, yields true the message matches the selector and will be sended to all output destinations pointed to by iterators in the rule destinations iterators set. In either case, next rule is then compared with the message and so on, until all rules have been processed.
Rule destinations iterators set consists of iterators pointing into the destination mapping table.
Selector is a set of selector elements - atomic conditions that express constrains on log messages (such as “priority greater or lower than some value”, etc.). To match any selector, a log message has to match all of the selector elements contained within.
Structure of the logger library (instance diagram - example).
![]() | Note |
---|---|
The #path/filename string is being used for specification of a log destination determined for the output into a file. Note that the path must be relative, because it will be merged with the path that specifies the logs root directory. This root path can be set in the configuration files, see Chapter 27, Understanding Configuration Values Related to the Core for more information. |