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

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, 4 insertions(+), 2 deletions(-)


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

diff --git a/EventBus.php b/EventBus.php
index eb0aaf1..ec7e42c 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 = [ 'backtrace' => debug_backtrace( 
DEBUG_BACKTRACE_IGNORE_ARGS ) ];
                        self::logger()->error( 'Must call send with at least 1 
event. Aborting send.', $context );
                        return;
                }
@@ -131,7 +132,8 @@
 
                if ( empty( $serializedEvents ) ) {
                        $context = [
-                               'backtrace' => debug_backtrace(),
+                               // Logstash doesn't like the args, because they 
could be of various types
+                               'backtrace' => debug_backtrace( 
DEBUG_BACKTRACE_IGNORE_ARGS ),
                                'events' => $events,
                                'json_last_error' => json_last_error()
                        ];

-- 
To view, visit https://gerrit.wikimedia.org/r/388038
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: master
Gerrit-Owner: Ppchelko <[email protected]>

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

Reply via email to