I want to use sentry to evaluate possible errors, exceptions, etc.
I tried to use the KunstmaanSentryBundle and it's great to catch all kind of errors like undefined functions and so on, but I want to define my own Monolog channel with it's own handler, but unfortunately I haven't found documentation about it.
config.yml
would be something like:
monolog:
handlers:
sentry:
type: stream
level: error
//Log to database parameter (raven for sentry)
Does anybody knows the right configuration?
This is part of config_prod.yml
:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: grouped_main
sentry:
type: raven
dsn: 'http://user:pass@url/1'
level: notice
# Groups
grouped_main:
type: group
members: [sentry, streamed_main]
# Streams
streamed_main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: error
Enjoy! :)
Wanted to add this as a comment on the accepted answer, but not enough rep, so:
From \Symfony\Bundle\MonologBundle\DependencyInjection\Configuration
:
"Possible handler types and related configurations (brackets indicate optional params):
"
Example config would be:
monolog:
handlers:
sentry:
type: raven
dsn: '%sentry_api_key%'
client_id: 'your.raven.client.custom.service.id'
level: notice
bubble: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With