LogTargetTrait ​
- Type
- Trait
- Namespace
- craft\base
- Since
- 3.1.23
LogTargetTrait implements the common methods and properties for log target classes.
Public Properties ​
Property | Description |
---|---|
includeUserIp | boolean – Whether the user IP should be included in the default log prefix. |
includeUserIp
​
- Type
- boolean
- Default value
false
- Since
- 3.0.25
Whether the user IP should be included in the default log prefix.
See also yii\log\Target::$prefix
Public Methods ​
Method | Description |
---|---|
getMessagePrefix() | Returns a string to be prefixed to the given message. |
getMessagePrefix()
​
Returns a string to be prefixed to the given message.
If yii\log\Target::$prefix is configured it will return the result of the callback.
See also yii\log\Target::getMessagePrefix()View source
Arguments ​
$message
(array) – The message being exported. The message structure follows that in yii\log\Logger::$messages.
Returns ​
string – The prefix string
Throws ​
Protected Methods ​
Method | Description |
---|---|
getContextMessage() | Generates the context information to be logged. |
getContextMessage()
​
Generates the context information to be logged.
See also yii\log\Target::getContextMessage()View source
Returns ​
string – The context information. If an empty string, it means no context information.