MonologTarget ​
- Type
- Class
- Namespace
- craft\log
- Inherits
- craft\log\MonologTarget »
samdark\log\PsrTarget
- Since
- 4.0.0
Class MonologTarget
Public Properties ​
Property | Description |
---|---|
contextMessage | string |
except | |
logContext | boolean – Whether to log request context |
contextMessage
​
- Type
- string
- Default value
null
except
​
- Default value
[ \yii\i18n\PhpMessageSource::class . ':*', \yii\web\HttpException::class . ':404', ]
logContext
​
- Type
- boolean
- Default value
true
Whether to log request context
Protected Properties ​
Property | Description |
---|---|
allowLineBreaks | boolean |
formatter | \Monolog\Formatter\FormatterInterface , null – The Monolog formatter to use. |
level | string – The PSR-3 log level to use. |
maxFiles | integer – The maximum number of files to keep in rotation. |
name | string |
processor | \Monolog\Processor\ProcessorInterface , null – The Monolog processor to use. |
useMicrosecondTimestamps | boolean |
allowLineBreaks
​
- Type
- boolean
- Default value
false
formatter
​
- Type
\Monolog\Formatter\FormatterInterface
, null- Default value
null
The Monolog formatter to use. Defaults to LineFormatter
.
level
​
- Type
- string
- Default value
\Psr\Log\LogLevel::WARNING
The PSR-3 log level to use.
maxFiles
​
- Type
- integer
- Default value
5
The maximum number of files to keep in rotation.
See also \Monolog\Handler\RotatingFileHandler::$maxFiles
name
​
- Type
- string
- Default value
null
See also \Monolog\Logger::$name
processor
​
- Type
\Monolog\Processor\ProcessorInterface
, null- Default value
null
The Monolog processor to use. Defaults to PsrLogMessageProcessor
.
useMicrosecondTimestamps
​
- Type
- boolean
- Default value
false
See also \Monolog\Logger::useMicrosecondTimestamps
Public Methods ​
Method | Description |
---|---|
export() | Log additional request context. |
getLogger() | |
init() | |
setAllowLineBreaks() | |
setFormatter() | |
setLevel() | |
setLogger() | |
setMaxFiles() | |
setName() | |
setProcessor() | |
setUseMicrosecondTimestamps() |
export()
​
Log additional request context.
getLogger()
​
Returns ​
\Monolog\Logger
init()
​
setAllowLineBreaks()
​
Arguments ​
$allowLineBreaks
(boolean)
Throws ​
setFormatter()
​
Arguments ​
$formatter
(\Monolog\Formatter\FormatterInterface
, null)
Throws ​
setLevel()
​
Arguments ​
Throws ​
setLogger()
​
Arguments ​
$logger
Throws ​
setMaxFiles()
​
Arguments ​
$maxFiles
(integer)
Throws ​
setName()
​
Arguments ​
$name
(string)
Throws ​
setProcessor()
​
Arguments ​
$processor
(\Monolog\Processor\ProcessorInterface
, null)
Throws ​
setUseMicrosecondTimestamps()
​
Arguments ​
$useMicrosecondTimestamps
(boolean)
Throws ​
Protected Methods ​
Method | Description |
---|---|
getContextMessage() | Context is logged via {@see self::export} method, so it can be added using Monolog. |
getContextMessage()
​
Context is logged via {@see self::export} method, so it can be added using Monolog.