phptek / silverstripe-sentry

Flexible Sentry compatible bug aggregation client for Silverstripe applications.
BSD 3-Clause "New" or "Revised" License
12 stars 22 forks source link

Constrain Default LogLevel #97

Open phptek opened 2 months ago

phptek commented 2 months ago

If user's don't modify their project's reporting levels, then the module defaults to the most verbose reporting level (Logger::Debug) which has deleterious effects on data-storage requirements of aggregation backends.

In order to ascertain how best to patch this, we need to get an idea of how the upstream sentry/sentry package treats configured severities e.g. given a project configured with INFO which is correct?

a). Only sends INFO messages to Sentry b). Sends INFO + (And above) messages to Sentry

See: https://github.com/phptek/silverstripe-sentry/blob/223d540ad4b73389e97e9cee379437d53442b17c/src/Adaptor/SentrySeverity.php#L51

This ticket therefore covers the following:

  1. Fix areas of SentryHandler and SentryLogger which don't appear to consume the configured level when reporting exceptions (messaging is OK)
  2. Modify Monolog\Logger::DEBUG to Monolog\Level::Warning
  3. Constrain the default in SentryLogger::factory() to use Monolog\Level::Warning
  4. Modify examples and docs to encourage use of Warning+