MediaWiki REL1_35
|
LogstashFormatter squashes the base message array and the context and extras subarrays into one. More...
Public Member Functions | |
__construct (string $applicationName, ?string $systemName=null, string $extraKey='', string $contextKey='ctxt_', $version=self::V0) | |
See T247675 for removing this override. | |
format (array $record) | |
Public Attributes | |
const | V0 = 0 |
const | V1 = 1 |
Protected Member Functions | |
fixKeyConflicts (array $fields, array $context) | |
Check whether some context field would overwrite another 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 NormalizerFormatter. | |
Protected Attributes | |
array | $reservedKeys |
Keys which should not be used in log context. | |
int | $version |
Logstash format version to use. | |
LogstashFormatter squashes the base message array and the context and extras subarrays into one.
This can result in unfortunately named context fields overwriting other data (T145133). This class modifies the standard LogstashFormatter to rename such fields and flag the message. Also changes exception JSON-ification which is done poorly by the standard class.
Definition at line 13 of file LogstashFormatter.php.
MediaWiki\Logger\Monolog\LogstashFormatter::__construct | ( | string | $applicationName, |
?string | $systemName = null , |
||
string | $extraKey = '' , |
||
string | $contextKey = 'ctxt_' , |
||
$version = self::V0 |
|||
) |
See T247675 for removing this override.
string | $applicationName | The application that sends the data, used as the "type" field of logstash |
string | null | $systemName | The system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine |
string | $extraKey | The key for extra keys inside logstash "fields", defaults to '' |
string | $contextKey | The key for context keys inside logstash "fields", defaults |
int | $version | The logstash format version to use, defaults to V0 to '' |
Definition at line 47 of file LogstashFormatter.php.
References MediaWiki\Logger\Monolog\LogstashFormatter\$version.
|
protected |
Check whether some context field would overwrite another message key.
If so, rename and flag.
array | $fields | Fields to be sent to logstash |
array | $context | Copy of the original $record['context'] |
Definition at line 205 of file LogstashFormatter.php.
MediaWiki\Logger\Monolog\LogstashFormatter::format | ( | array | $record | ) |
Reimplemented in MediaWiki\Logger\Monolog\CeeFormatter.
Definition at line 54 of file LogstashFormatter.php.
|
protected |
Borrowed from monolog/monolog 1.25.3 https://github.com/Seldaek/monolog/blob/1.x/src/Monolog/Formatter/LogstashFormatter.php#L87-L128.
array | $record |
Definition at line 91 of file LogstashFormatter.php.
|
protected |
Borrowed mostly from monolog/monolog 1.25.3 https://github.com/Seldaek/monolog/blob/1.25.3/src/Monolog/Formatter/LogstashFormatter.php#L130-165.
array | $record |
Definition at line 157 of file LogstashFormatter.php.
|
protected |
Prevent key conflicts.
array | $record |
Definition at line 70 of file LogstashFormatter.php.
|
protected |
Prevent key conflicts.
array | $record |
Definition at line 138 of file LogstashFormatter.php.
|
protected |
Use a more user-friendly trace format than NormalizerFormatter.
\\Throwable | $e | |
int | $depth |
Definition at line 225 of file LogstashFormatter.php.
|
protected |
Keys which should not be used in log context.
Definition at line 19 of file LogstashFormatter.php.
|
protected |
Logstash format version to use.
Definition at line 33 of file LogstashFormatter.php.
Referenced by MediaWiki\Logger\Monolog\LogstashFormatter\__construct().
const MediaWiki\Logger\Monolog\LogstashFormatter::V0 = 0 |
Definition at line 15 of file LogstashFormatter.php.
const MediaWiki\Logger\Monolog\LogstashFormatter::V1 = 1 |
Definition at line 16 of file LogstashFormatter.php.