...
Code Block | ||||
---|---|---|---|---|
| ||||
// use the default logger instance: $logger = Zend_Registry::get('logger'); $logger->addWriter('name', $writerInstance); |
Filtering
Each writer can have an list of filter rules. See the above module.ini example. The filter rules are connected via "or", that means one of the filter rules must be valid in order that an event is logged.
Code Block | ||
---|---|---|
| ||
resources.ZfExtended_Resource_Logger.writer.tasklog.filter[] = "level <= warn" ; first filter rule
resources.ZfExtended_Resource_Logger.writer.tasklog.filter[] = "level <= debug; origin ^= core.foo.bar" ; second filter rule
|
Each filter rule is it self, a semicolon separated list of expressions. All expressions of one rule are connected via "and", so all expressions must be evaluated to true in order that the rule is valid.
An expression consists of a keyword, an operator and a value, for example: "level <= warn". Each keyword can be used multiple times, so "level >= warn; level <= trace" would also be possible.
Warning |
---|
They keyword must be always the first operand! So "warn <= level" would give an error since it can not be parsed. |
In the following table a list of valid keywords and operands is listed:
Keyword | Valid Operands | Description | |
---|---|---|---|
level | <= >= = | Is used to compare with the log levels as defined at the top of this page. The second operand must be a valid log level: "fatal", "error", "warn" etc. | |
origin | = ^= $= *= | The origin of the event must be matched either completely, or just a part of the string, as defined by the usable string operators. | |
exception | = *= | The exception equals (= operator) the given exception class name, or the current exception is a subclass of the given exception name (*= operator). |
Logging Database Tables
Currently there are two database tables receiving events:
...
// Plugin_Demo_Exception are handled via the final handler and stops the PHP request
debug