Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323099

Change subject: Revert "Warn when a log context accidentally overrides a log 
processor"
......................................................................

Revert "Warn when a log context accidentally overrides a log processor"

This reverts commit 057b870b47a56fa8e7e056df02c2334d2273caea.

Bug: T145133
Change-Id: I31caee865cd60c785126478ac75c9aefce78eaaf
---
M includes/debug/logger/monolog/WikiProcessor.php
1 file changed, 1 insertion(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/323099/1

diff --git a/includes/debug/logger/monolog/WikiProcessor.php 
b/includes/debug/logger/monolog/WikiProcessor.php
index 81e1e14..ad939a0 100644
--- a/includes/debug/logger/monolog/WikiProcessor.php
+++ b/includes/debug/logger/monolog/WikiProcessor.php
@@ -29,17 +29,6 @@
  * @copyright © 2013 Bryan Davis and Wikimedia Foundation.
  */
 class WikiProcessor {
-       /** @var array Keys which should not be used in log context */
-       protected $reservedKeys = [
-               // from 
monolog:src/Monolog/Formatter/LogstashFormatter.php#L71-L88
-               'message', 'channel', 'level', 'type',
-               // from WebProcessor
-               'url', 'ip', 'http_method', 'server', 'referrer',
-               // from WikiProcessor
-               'host', 'wiki', 'reqId', 'mwversion',
-               // from config magic
-               'normalized_message',
-       ];
 
        /**
         * @param array $record
@@ -47,15 +36,6 @@
         */
        public function __invoke( array $record ) {
                global $wgVersion;
-
-               // some log aggregators such as Logstash will merge the log 
context into the main
-               // metadata and end up overwriting the data coming from 
processors
-               foreach ( $this->reservedKeys as $key ) {
-                       if ( isset( $record['context'][$key] ) ) {
-                               wfLogWarning( __METHOD__ . ": '$key' key 
overwritten in log context." );
-                       }
-               }
-
                $record['extra'] = array_merge(
                        $record['extra'],
                        [
@@ -67,4 +47,5 @@
                );
                return $record;
        }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/323099
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31caee865cd60c785126478ac75c9aefce78eaaf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to