https://github.com/Seldaek/monolog/releases/tag/2.0.2 https://github.com/Seldaek/monolog/releases/tag/2.0.1 https://github.com/Seldaek/monolog/releases/tag/2.0.0 https://github.com/Seldaek/monolog/blob/2.0.0/UPGRADE.md https://github.com/Seldaek/monolog/compare/1.25.3...2.0.2 Import LogstashFormatter::formatV1 from monolog/monolog 1.25.3, so that we don't change the format Bug: T242751 Change-Id: I0198a28a5c39631d6989abf842d8a5153ccee17d Depends-On: I31ad7dc288ceb35e042b2fef7248a0319016fbfc
21 lines
569 B
PHP
21 lines
569 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Logger\Monolog;
|
|
|
|
/**
|
|
* CeeFormatter extends LogstashFormatter to prefix records with a "cee cookie".
|
|
* The cookie is used to tell JSON and non-JSON messages apart when logging to syslog.
|
|
* See also: https://www.rsyslog.com/doc/v8-stable/configuration/modules/mmjsonparse.html
|
|
*
|
|
* @since 1.33
|
|
*/
|
|
class CeeFormatter extends LogstashFormatter {
|
|
/**
|
|
* Format records with a cee cookie
|
|
* @param array $record
|
|
* @return string
|
|
*/
|
|
public function format( array $record ): string {
|
|
return "@cee: " . parent::format( $record );
|
|
}
|
|
}
|