Ppchelko has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388399 )

Change subject: Ignore args when getting backtraces for logging.
......................................................................

Ignore args when getting backtraces for logging.

In logstash the type mappings are static, so args provided
by debug_backtrace prevents us from logging EvenBus events
to logstash.

Bug: T150106
Change-Id: I4f41ad56aa9d6e625daa3709e7679055622a55b7
---
M EventBus.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventBus 
refs/changes/99/388399/1

diff --git a/EventBus.php b/EventBus.php
index eb0aaf1..4f2ced0 100644
--- a/EventBus.php
+++ b/EventBus.php
@@ -64,7 +64,8 @@
         */
        public function send( $events ) {
                if ( empty( $events ) ) {
-                       $context = [ 'backtrace' => debug_backtrace() ];
+                       // Logstash doesn't like the args, because they could 
be of various types
+                       $context = [ 'exception' => new Exception() ];
                        self::logger()->error( 'Must call send with at least 1 
event. Aborting send.', $context );
                        return;
                }
@@ -131,7 +132,7 @@
 
                if ( empty( $serializedEvents ) ) {
                        $context = [
-                               'backtrace' => debug_backtrace(),
+                               'exception' => new Exception(),
                                'events' => $events,
                                'json_last_error' => json_last_error()
                        ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f41ad56aa9d6e625daa3709e7679055622a55b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventBus
Gerrit-Branch: wmf/1.31.0-wmf.6
Gerrit-Owner: Ppchelko <ppche...@wikimedia.org>

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

Reply via email to