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

Change subject: Move exception trace into log data
......................................................................

Move exception trace into log data

Data object is not included in failmail, but should still be logged.

Bug: T155757
Change-Id: Id2ac43afb19f36f8e28bdf5d6852e40814983d9e
---
M Core/Logging/LogEvent.php
1 file changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/41/333041/1

diff --git a/Core/Logging/LogEvent.php b/Core/Logging/LogEvent.php
index 3d2e43b..41b77d4 100644
--- a/Core/Logging/LogEvent.php
+++ b/Core/Logging/LogEvent.php
@@ -55,7 +55,7 @@
                                        $jdata = $data->toJson();
                                }
                                catch ( DataSerializationException $ex ) {
-          }
+                               }
                        } else {
                                $jdata = json_encode( $data );
                        }
@@ -69,6 +69,13 @@
                        $this->data = null;
                }
 
+               if ( $exception ) {
+                       if ( $this->data === null ) {
+                               $this->data = $exception->getTraceAsString();
+                       } else {
+                               $this->data .= $exception->getTraceAsString();
+                       }
+               }
                if ( !$timestamp ) {
                        $this->timestamp = time();
                        $this->datestring = date( 'c' );
@@ -101,10 +108,6 @@
                } while ( $cex );
                $descStr = implode( ' -> ', array_reverse( $descStr ) );
 
-               // Get the stack trace
-               $stack = explode( "\n", $this->exception->getTraceAsString() );
-
-               array_unshift( $stack, $descStr );
-               return $stack;
+               return $descStr;
        }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2ac43afb19f36f8e28bdf5d6852e40814983d9e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

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

Reply via email to