-
Notifications
You must be signed in to change notification settings - Fork 185
-
The docs are quite unclear (atleast for me)
The goal is to log exceptions and all the logs leading up to that exception in a Sentry Issue (I am using monolog).
At the moment I'm not clear how the monolog Logging settings affects that or doest, both of my attempts have failed.
Attempt 1 - with monolog logger
sentry.yaml
sentry: dsn: '%env(SENTRY_DSN)%' # https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration register_error_listener: false register_error_handler: false options/ options: environment: '%env(SENTRY_ENVIRONMENT)%' release: '%env(SENTRY_RELEASE)%'
monolog.yaml
monolog: handlers: main: type: fingers_crossed action_level: error handler: nested excluded_http_codes: [404, 405] buffer_size: 50 channels: ["!event", "!doctrine", "!php"] nested: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug formatter: monolog.formatter.json console: type: console process_psr_3_messages: false channels: ["!event", "!doctrine"] sentry: type: sentry level: '%mk.sentry.log_level%' hub_id: Sentry\State\HubInterface channels: ["!deprecation"]
Attempt 2 - without monolog
sentry.yaml
sentry: dsn: '%env(SENTRY_DSN)%' # https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration register_error_listener: true register_error_handler: true options/ options: environment: '%env(SENTRY_ENVIRONMENT)%' release: '%env(SENTRY_RELEASE)%'
monolog.yaml
monolog: handlers: main: type: fingers_crossed action_level: error handler: nested excluded_http_codes: [404, 405] buffer_size: 50 channels: ["!event", "!doctrine", "!php"] nested: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug formatter: monolog.formatter.json console: type: console process_psr_3_messages: false channels: ["!event", "!doctrine"]
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
I would like to know this too, currently all the logs are shown in the sentry as separate issues.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment