MediaWiki
1.30.0
|
LogstashFormatter squashes the base message array and the context and extras subarrays into one. More...
Protected Member Functions | |
fixKeyConflicts (array $fields, array $context) | |
Check whether some context field would overwrite another message key. More... | |
formatV0 (array $record) | |
Prevent key conflicts. More... | |
formatV1 (array $record) | |
Prevent key conflicts. More... | |
normalizeException ( $e) | |
Use a more user-friendly trace format than NormalizerFormatter. More... | |
Protected Attributes | |
array | $reservedKeys |
Keys which should not be used in log context. More... | |
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.
Compatible with Monolog 1.x only.
Definition at line 15 of file LogstashFormatter.php.
|
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 71 of file LogstashFormatter.php.
References MediaWiki\$context, and as.
Referenced by MediaWiki\Logger\Monolog\LogstashFormatter\formatV0(), and MediaWiki\Logger\Monolog\LogstashFormatter\formatV1().
|
protected |
Prevent key conflicts.
array | $record |
Definition at line 33 of file LogstashFormatter.php.
References MediaWiki\$context, and MediaWiki\Logger\Monolog\LogstashFormatter\fixKeyConflicts().
|
protected |
Prevent key conflicts.
array | $record |
Definition at line 51 of file LogstashFormatter.php.
References MediaWiki\$context, and MediaWiki\Logger\Monolog\LogstashFormatter\fixKeyConflicts().
|
protected |
Use a more user-friendly trace format than NormalizerFormatter.
\\Exception | \\Throwable | $e |
Definition at line 90 of file LogstashFormatter.php.
References $e, and MWExceptionHandler\getRedactedTraceAsString().
|
protected |
Keys which should not be used in log context.
Definition at line 17 of file LogstashFormatter.php.