Skip to content

Commit e7dc2a8

Browse files
authored
Add sentry structured logging config (#1853)
* Add structured logging config * newline * comments
1 parent 80ebbce commit e7dc2a8

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

sentry/sentry-symfony/5.0/config/packages/sentry.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,29 @@ when@prod:
88
ignore_exceptions:
99
- 'Symfony\Component\ErrorHandler\Error\FatalError'
1010
- 'Symfony\Component\Debug\Exception\FatalErrorException'
11-
12-
# If you are using Monolog, you also need this additional configuration to log the errors correctly:
13-
# https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration
11+
#
12+
# # If you are using Monolog, you also need this additional configuration to log the errors correctly:
13+
# # https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration
1414
# register_error_listener: false
1515
# register_error_handler: false
16-
16+
#
1717
# monolog:
1818
# handlers:
19+
# # Use this only if you don't want to use structured logging and instead receive
20+
# # certain log levels as errors.
1921
# sentry:
2022
# type: sentry
2123
# level: !php/const Monolog\Logger::ERROR
2224
# hub_id: Sentry\State\HubInterface
2325
# fill_extra_context: true # Enables sending monolog context to Sentry
2426
# process_psr_3_messages: false # Disables the resolution of PSR-3 placeholders
27+
#
28+
# # Use this for structured log integration
29+
# sentry_logs:
30+
# type: service
31+
# id: Sentry\SentryBundle\Monolog\LogsHandler
32+
#
33+
# services:
34+
# Sentry\SentryBundle\Monolog\LogsHandler:
35+
# arguments:
36+
# - !php/const Monolog\Logger::INFO

0 commit comments

Comments
 (0)