Ppchelko has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/389946 )
Change subject: Limit the log size to 8kb to avoid logstash truncates
......................................................................
Limit the log size to 8kb to avoid logstash truncates
Change-Id: Id216829f422cd96278d56e84b3d25280d54c859b
---
M EventBus.php
1 file changed, 5 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventBus
refs/changes/46/389946/1
diff --git a/EventBus.php b/EventBus.php
index 4f2ced0..63346e9 100644
--- a/EventBus.php
+++ b/EventBus.php
@@ -105,13 +105,12 @@
// In case the event posted was too big we don't want
to log all the request body
// as it contains all
$context = [
- 'EventBus' => [
- 'events' => $events,
- 'response' => $res
- ]
+ 'events' => $events,
+ 'response' => $res
];
- // Limit the maximum size of the logged context to 1
megabyte
- if ( strlen( $body ) > 1048576 ) {
+ // Limit the maximum size of the logged context to 8
kilobytes as that's where logstash
+ // truncates the JSON anyway
+ if ( strlen( $body ) > 8192 ) {
$context['EventBus']['events'] = array_column(
$events, 'meta' );
}
self::logger()->error( "Unable to deliver all events:
${message}", $context );
--
To view, visit https://gerrit.wikimedia.org/r/389946
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id216829f422cd96278d56e84b3d25280d54c859b
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