A log target object will filter the messages logged by
according
to its [[levels]] and [[categories]] properties. It may also export the filtered
messages to specific destination defined by the target, such as emails, files.
Level filter and category filter are combinatorial, i.e., only messages
satisfying both filter conditions will be handled. Additionally, you
may specify [[except]] to exclude messages of certain categories.
getContextMessage()
protected method
The default implementation will dump user information, system variables, etc.
setLevels()
public method
The parameter can be either an array of interested level names or an integer representing
the bitmap of the interested level values. Valid level names include: 'error',
'warning', 'info', 'trace' and 'profile'; valid level values include:
[[Logger::LEVEL_ERROR]], [[Logger::LEVEL_WARNING]], [[Logger::LEVEL_INFO]],
[[Logger::LEVEL_TRACE]] and [[Logger::LEVEL_PROFILE]].
For example,
php
['error', 'warning']
which is equivalent to:
Logger::LEVEL_ERROR | Logger::LEVEL_WARNING
$categories public_oe property
list of message categories that this target is interested in. Defaults to empty, meaning all categories.
You can use an asterisk at the end of a category so that the category may be used to
match those categories sharing the same common prefix. For example, 'yii\db\*' will match
categories starting with 'yii\db\', such as 'yii\db\Connection'.
$except public_oe property
list of message categories that this target is NOT interested in. Defaults to empty, meaning no uninteresting messages.
If this property is not empty, then any category listed here will be excluded from [[categories]].
You can use an asterisk at the end of a category so that the category can be used to
match those categories sharing the same common prefix. For example, 'yii\db\*' will match
categories starting with 'yii\db\', such as 'yii\db\Connection'.
$logVars public_oe property
list of the PHP predefined variables that should be logged in a message.
Note that a variable must be accessible via $GLOBALS. Otherwise it won't be logged.
Defaults to ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'].
Since version 2.0.9 additional syntax can be used:
Each element could be specified as one of the following:
- var - var will be logged.
- var.key - only var[key] key will be logged.
- !var.key - var[key] key will be excluded.