BryanDavis has uploaded a new change for review.

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

Change subject: Replace use of wfErrorLog() with MWLoggerLegacyLogger::emit()
......................................................................

Replace use of wfErrorLog() with MWLoggerLegacyLogger::emit()

When the logging service used by MediaWiki is not MWLoggerLegacySpi, the
behavior of the legacy wfErrorLog method is not guaranteed.
MWLoggerLegacyLogger::emit() is the suggested replacement for use cases
such as this one where the desired log destination is either a file or
a UDP endpoint.

Change-Id: Ibb743b39133f24dd9613eddc02881b08c4ca62e7
---
M EventLogging.php
M includes/EventLogging.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/70/180070/1

diff --git a/EventLogging.php b/EventLogging.php
index 2e834f1..189a395 100644
--- a/EventLogging.php
+++ b/EventLogging.php
@@ -67,7 +67,7 @@
  * convention it specifies which log bucket the message should be routed
  * to. It is best if the prefix is simply "EventLogging".
  *
- * @see wfErrorLog()
+ * @see MWLoggerLegacyLogger::emit()
  *
  * @example string: 'udp://127.0.0.1:9000/EventLogging'
  * @example string: '/var/log/mediawiki/events.log'
diff --git a/includes/EventLogging.php b/includes/EventLogging.php
index 4a55ae0..b74d4ed 100644
--- a/includes/EventLogging.php
+++ b/includes/EventLogging.php
@@ -21,7 +21,7 @@
         * $wgEventLoggingFile. If $wgEventLoggingFile is not set, returns
         * false without logging anything.
         *
-        * @see wfErrorLog
+        * @see MWLoggerLegacyLogger::emit
         *
         * @param string $schemaName Schema name.
         * @param int $revId revision ID of schema.
@@ -65,7 +65,7 @@
 
                $json = static::serializeEvent( $encapsulated );
 
-               wfErrorLog( $json . "\n", $wgEventLoggingFile );
+               MWLoggerLegacyLogger::emit( $json . "\n", $wgEventLoggingFile );
                wfProfileOut( __METHOD__ );
                return true;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb743b39133f24dd9613eddc02881b08c4ca62e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to