Connehito / cake-sentry

CakePHP plugin integration for Sentry
MIT License
34 stars 26 forks source link

Record useful logs as Breadcrumbs to understand and reproduce the situation. #72

Open o0h opened 3 years ago

o0h commented 3 years ago

Sentry provides a feature called Breadcrumbs. According to the mention on the official site, this feature is intended for server-side use in the following ways

Sentry server-side SDKs, including Python and PHP, provide breadcrumbs for logging messages, network requests, database queries, and more. https://sentry.io/features/breadcrumbs/

If this plugin can also retain "what was happening" with these features, the development and maintenance of CakePHP applications will be even more pleasant.

In sentry-laravel, The following PR is the initial version implemented. https://github.com/getsentry/sentry-laravel/pull/31/files

Would it be possible to perform a similar process? I think it's worth looking into.

o0h commented 3 years ago

Instead of "logging events", If the plugin provides a "log engine that handles Sentry breadcrumbs" that corresponds to CakePHP's original logging mechanism, we can handle in an intuitive way INFO logs and QUERY logs which we need?

o0h commented 3 years ago

Sentry's Breadcrumb can have some fields as below.

If I implement this as a log engine rather than a method of subscribing to events, can I extract the information corresponding to the following fields? Some of these may include name, subject, etc. if it is an Event, there may be room to utilize them.