LogTargetTrait

Type
Trait
Namespace
craft\base
Implemented by
craft\log\FileTarget
Since
3.1.23

LogTargetTrait implements the common methods and properties for log target classes.

View source

# Public Properties

Property Description
includeUserIp boolean – Whether the user IP should be included in the default log prefix.

# includeUserIp

Type
boolean
Since
3.0.25

Whether the user IP should be included in the default log prefix.

See also yii\log\Target::$prefix

View source

# 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

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.