MonologTarget
- Type
- Class
- Namespace
- craft\log
- Inherits
- craft\log\MonologTarget »
samdark\log\PsrTarget
- Since
- 4.0.0
Class MonologTarget
View source (opens new window)
# Public Properties
Property | Description |
---|---|
contextMessage | string (opens new window) |
except | |
logContext | boolean (opens new window) – Whether to log request context |
# contextMessage
- Type
- string (opens new window)
- Default value
null
View source (opens new window)
# except
- Default value
[ \yii\i18n\PhpMessageSource::class . ':*', \yii\web\HttpException::class . ':404', ]
View source (opens new window)
# logContext
- Type
- boolean (opens new window)
- Default value
true
Whether to log request context
View source (opens new window)
# Protected Properties
Property | Description |
---|---|
allowLineBreaks | boolean (opens new window) |
formatter | \Monolog\Formatter\FormatterInterface , null (opens new window) – The Monolog formatter to use. |
level | string (opens new window) – The PSR-3 log level to use. |
logger | \Monolog\Logger , null (opens new window) |
maxFiles | integer (opens new window) – The maximum number of files to keep in rotation. |
name | string (opens new window) |
processor | \Monolog\Processor\ProcessorInterface , null (opens new window) – The Monolog processor to use. |
useMicrosecondTimestamps | boolean (opens new window) |
# allowLineBreaks
- Type
- boolean (opens new window)
- Default value
false
View source (opens new window)
# formatter
- Type
\Monolog\Formatter\FormatterInterface
, null (opens new window)- Default value
null
The Monolog formatter to use. Defaults to LineFormatter
.
View source (opens new window)
# level
- Type
- string (opens new window)
- Default value
\Psr\Log\LogLevel::WARNING
The PSR-3 log level to use.
View source (opens new window)
# logger
- Type
\Monolog\Logger
, null (opens new window)- Default value
null
View source (opens new window)
# maxFiles
- Type
- integer (opens new window)
- Default value
5
The maximum number of files to keep in rotation.
See also \Monolog\Handler\RotatingFileHandler::$maxFiles
View source (opens new window)
# name
- Type
- string (opens new window)
- Default value
null
See also \Monolog\Logger::$name
View source (opens new window)
# processor
- Type
\Monolog\Processor\ProcessorInterface
, null (opens new window)- Default value
null
The Monolog processor to use. Defaults to PsrLogMessageProcessor
.
View source (opens new window)
# useMicrosecondTimestamps
- Type
- boolean (opens new window)
- Default value
false
See also \Monolog\Logger::useMicrosecondTimestamps
View source (opens new window)
# Public Methods
Method | Description |
---|---|
export() | Log additional request context. |
getLogger() | |
init() | |
setAllowLineBreaks() | |
setFormatter() | |
setLevel() | |
setLogger() | |
setMaxFiles() | |
setName() | |
setProcessor() | |
setUseMicrosecondTimestamps() |
# export()
Log additional request context.
View source (opens new window)
# getLogger()
View source (opens new window)
Returns
\Monolog\Logger
# init()
View source (opens new window)
# setAllowLineBreaks()
View source (opens new window)
Arguments
$allowLineBreaks
(boolean (opens new window))
Throws
# setFormatter()
View source (opens new window)
Arguments
$formatter
(\Monolog\Formatter\FormatterInterface
, null (opens new window))
Throws
# setLevel()
View source (opens new window)
Arguments
Throws
# setLogger()
View source (opens new window)
Arguments
$logger
Throws
# setMaxFiles()
View source (opens new window)
Arguments
$maxFiles
(integer (opens new window))
Throws
# setName()
View source (opens new window)
Arguments
$name
(string (opens new window))
Throws
# setProcessor()
View source (opens new window)
Arguments
$processor
(\Monolog\Processor\ProcessorInterface
, null (opens new window))
Throws
# setUseMicrosecondTimestamps()
View source (opens new window)
Arguments
$useMicrosecondTimestamps
(boolean (opens new window))
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.