diff --git a/src/HelfiApiBaseServiceProvider.php b/src/HelfiApiBaseServiceProvider.php index 8957b59..efeac30 100644 --- a/src/HelfiApiBaseServiceProvider.php +++ b/src/HelfiApiBaseServiceProvider.php @@ -33,6 +33,22 @@ public function register(ContainerBuilder $container) : void { $container->setParameter('monolog.channel_handlers', [ 'default' => [ 'handlers' => [ + [ + // The Raven logger handler must be added to forward log messages + // to Sentry. We remove the `message_placeholder` processor from + // the default processors, as Raven already handles placeholders. + // NOTE: The `filter_backtrace` processor should be included. + // Without it, logging long backtraces may lead to out-of-memory + // errors. + 'name' => 'drupal.raven', + 'processors' => [ + 'current_user', + 'request_uri', + 'ip', + 'referer', + 'filter_backtrace', + ], + ], [ 'name' => 'default_conditional_handler', 'formatter' => 'drush_or_json',