MediaWiki master
MediaWiki\Logger\Monolog\CeeFormatter Class Reference

Prefixed version of LogstashFormatter that adds a "cee cookie" for Rsyslog. More...

Inherits MediaWiki\Logger\Monolog\LogstashFormatter.

Collaboration diagram for MediaWiki\Logger\Monolog\CeeFormatter:

Public Member Functions

 format (array $record)
 Format records with a cee cookie.
 
- Public Member Functions inherited from MediaWiki\Logger\Monolog\LogstashFormatter
 __construct (string $applicationName, ?string $systemName=null, string $extraKey='', string $contextKey='ctxt_', $version=self::V0)
 TODO: See T247675 for removing this override.
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Logger\Monolog\LogstashFormatter
const V0 = 0
 
const V1 = 1
 
- Protected Member Functions inherited from MediaWiki\Logger\Monolog\LogstashFormatter
 fixKeyConflicts (array $fields, array $context)
 Rename any context field that would otherwise overwrite a message key.
 
 formatMonologV0 (array $record)
 Borrowed from monolog/monolog 1.25.3 https://github.com/Seldaek/monolog/blob/1.x/src/Monolog/Formatter/LogstashFormatter.php#L87-L128.
 
 formatMonologV1 (array $record)
 Borrowed mostly from monolog/monolog 1.25.3 https://github.com/Seldaek/monolog/blob/1.25.3/src/Monolog/Formatter/LogstashFormatter.php#L130-165.
 
 formatV0 (array $record)
 Prevent key conflicts.
 
 formatV1 (array $record)
 Prevent key conflicts.
 
 normalizeException (\Throwable $e, int $depth=0)
 Use a more user-friendly trace format than Monolog\Formatter\NormalizerFormatter.
 
- Protected Attributes inherited from MediaWiki\Logger\Monolog\LogstashFormatter
array $reservedKeys
 Keys which should not be used in log context.
 
int $version
 Logstash format version to use.
 

Detailed Description

Prefixed version of LogstashFormatter that adds a "cee cookie" for Rsyslog.

The prefix lets Ryslog differentiate between JSON and non-JSON messages.

See also: https://www.rsyslog.com/doc/v8-stable/configuration/modules/mmjsonparse.html

Since
1.33

Definition at line 15 of file CeeFormatter.php.

Member Function Documentation

◆ format()

MediaWiki\Logger\Monolog\CeeFormatter::format ( array $record)

Format records with a cee cookie.

Parameters
array$record
Returns
string

Reimplemented from MediaWiki\Logger\Monolog\LogstashFormatter.

Definition at line 21 of file CeeFormatter.php.


The documentation for this class was generated from the following file: