19 'message',
'channel',
'level',
'type',
21 'url',
'ip',
'http_method',
'server',
'referrer',
23 'host',
'wiki',
'reqId',
'mwversion',
34 if ( $this->contextPrefix ) {
35 return parent::formatV0( $record );
38 $context = !empty( $record[
'context'] ) ? $record[
'context'] : [];
39 $record[
'context'] = [];
40 $formatted = parent::formatV0( $record );
52 if ( $this->contextPrefix ) {
53 return parent::formatV1( $record );
56 $context = !empty( $record[
'context'] ) ? $record[
'context'] : [];
57 $record[
'context'] = [];
58 $formatted = parent::formatV1( $record );
72 foreach (
$context as $key => $val ) {
74 in_array( $key, $this->reservedKeys,
true ) &&
75 isset( $fields[$key] ) && $fields[$key] !== $val
77 $fields[
'logstash_formatter_key_conflict'][] = $key;
91 if ( !$e instanceof \Exception && !$e instanceof \Throwable ) {
92 throw new \InvalidArgumentException(
'Exception/Throwable expected, got '
93 . gettype( $e ) .
' / ' . get_class( $e ) );
97 'class' => get_class( $e ),
98 'message' => $e->getMessage(),
99 'code' => $e->getCode(),
100 'file' => $e->getFile() .
':' . $e->getLine(),
104 $previous = $e->getPrevious();