Skip to content

MonologTarget

Type
Class
Namespace
craft\log
Inherits
craft\log\MonologTarget » samdark\log\PsrTarget
Since
4.0.0

Class MonologTarget

View source

Public Properties

PropertyDescription
contextMessagestring
except
logContextboolean – Whether to log request context

contextMessage

Type
string
Default value
null

View source

except

Default value
[ \yii\i18n\PhpMessageSource::class . ':*', \yii\web\HttpException::class . ':404', ]

View source

logContext

Type
boolean
Default value
true

Whether to log request context

View source

Protected Properties

PropertyDescription
allowLineBreaksboolean
formatter\Monolog\Formatter\FormatterInterface, null – The Monolog formatter to use.
levelstring – The PSR-3 log level to use.
maxFilesinteger – The maximum number of files to keep in rotation.
namestring
processor\Monolog\Processor\ProcessorInterface, null – The Monolog processor to use.
useMicrosecondTimestampsboolean

allowLineBreaks

Type
boolean
Default value
false

View source

formatter

Type
\Monolog\Formatter\FormatterInterface, null
Default value
null

The Monolog formatter to use. Defaults to LineFormatter.

View source

level

Type
string
Default value
\Psr\Log\LogLevel::WARNING

The PSR-3 log level to use.

View source

maxFiles

Type
integer
Default value
5

The maximum number of files to keep in rotation.

See also \Monolog\Handler\RotatingFileHandler::$maxFiles

View source

name

Type
string
Default value
null

See also \Monolog\Logger::$name

View source

processor

Type
\Monolog\Processor\ProcessorInterface, null
Default value
null

The Monolog processor to use. Defaults to PsrLogMessageProcessor.

View source

useMicrosecondTimestamps

Type
boolean
Default value
false

See also \Monolog\Logger::useMicrosecondTimestamps

View source

Public Methods

MethodDescription
export()Log additional request context.
getLogger()
init()
setAllowLineBreaks()
setFormatter()
setLevel()
setLogger()
setMaxFiles()
setName()
setProcessor()
setUseMicrosecondTimestamps()

export()

Log additional request context.

View source

getLogger()

View source

Returns

\Monolog\Logger

init()

View source

setAllowLineBreaks()

View source

Arguments

Throws

setFormatter()

View source

Arguments

  • $formatter (\Monolog\Formatter\FormatterInterface, null)

Throws

setLevel()

View source

Arguments

Throws

setLogger()

View source

Arguments

  • $logger

Throws

setMaxFiles()

View source

Arguments

Throws

setName()

View source

Arguments

Throws

setProcessor()

View source

Arguments

  • $processor (\Monolog\Processor\ProcessorInterface, null)

Throws

setUseMicrosecondTimestamps()

View source

Arguments

  • $useMicrosecondTimestamps (boolean)

Throws

Protected Methods

MethodDescription
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.

View source