getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
323 stars 1.38k forks source link

Provide docs for Monolog integration and make it an "official integration". #7444

Open timkelty opened 12 months ago

timkelty commented 12 months ago

Problem Statement

If you want to use Sentry via Monolog and are not using a supported framework like Laravel or Symfony, it is not clear how to proceed.

Given that Monolog pretty much the defacto logging lib for PHP, it seems like this should be an "official integration". Having a supported Monolog handler should also reduce the need for bespoke framework integrations, or at least the amount of code they have to supply.

https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php exists, but has no docs.

To make things more confusing:

Solution Brainstorm

getsantry[bot] commented 11 months ago

Assigning to @getsentry/support for routing ⏲️

cleptric commented 11 months ago

Laravel already uses the PHP SDKs Monolog Handler, see https://github.com/getsentry/sentry-laravel/blob/master/src/Sentry/Laravel/SentryHandler.php#L23.

We used to have docs for this, looks like they got forgotten about during the last major version migration.

For now, something like https://github.com/Seldaek/monolog#basic-usage should do the trick.

B-Galati commented 11 months ago

Agree. If I am not mistaken, other languages SDK are using logging lib as well.