Skip to content

Docs confusing about what kind of integration / logging to use and how #994

Description

@aleho

Problem Statement

Trying to understand what this bundle does by reading the code I'm still not sure what kind of setup and integration I want for different types of projects.

There's:

  • register_error_listener
  • register_error_handler
  • enable_logs
  • ignore_exceptions
  • Sentry\Monolog\Handler; Monolog handler sentry
  • Sentry\SentryBundle\Monolog\LogsHandler; Monolog handler sentry_logs

Not even the recipe or reading the docs multiple times helps to clearly understand which setup results in which behavior. To make matters even worse, migrating to Symfony 8 and Monolog bundle 4, I think I managed to configure one of our applications running on FrankenPHP workers to build a huge memory leak resulting in segfaults.

Out of the box the error handler (whichever that is, I lost track) logs completely valid exceptions as errors. In Symfony it's totally normal to have a NotFoundHttpException or all the other 4xx being thrown which never is an actual exception, but our logs would be full of them without a big list of ignore_exception entries I have to maintain across projects. That's especially nice if you forgot for one project and some AI scaper goes wild and produces a ton of 404s or 403s, completely exhausting your monthly Sentry budget within minutes.

Solution Brainstorm

There should be more detailed documentation on the behavior of each configuration value and Monolog handler. E.e., an annotated full configuration example for both handlers.

It would also be helpful to understand when these handlers log. On shutdown? Monolog reset()? Do they even play nice with FrankenPHP or Symfony ResetInterface?

Apart from that, information on the amount of logging data being collected and sent and also the performance impact would be very much welcome. E.g., the amount of spans created in one of our apps has about 1000 times higher pressure on CPU and memory than any other code according to a profiling session in XDebug after a few requests in a FrankenPHP worker. This is absolutely not acceptable if you only want error logging but might be totally fine in an application where you have to monitor performance regressions.

Metadata

Metadata

Assignees

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions