Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLT-1136: Drupal chart: Use JSON as the default formatter for application logs when handled by monolog #736

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions charts/drupal/files/silta.services.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
parameters:
monolog.channel_handlers:
# Log to stderr by default.
default: ['stream']
default:
handlers:
- name: 'stream'
formatter: 'json'
processors:
- 'message_placeholder'
- 'request_uri'
- 'referer'
- 'current_user'
- 'ip'
- 'filter_backtrace'

services:
# Defines a 'stream' channel handler used above.
# Log to stderr by default.
# The minimum (also default) logging level is 100 (DEBUG), we set it here explicitly for better visibility.
monolog.handler.stream:
class: Monolog\Handler\StreamHandler
# The minimum logging level DEBUG = 100
arguments: ['php://stderr', 100]
arguments: [ 'php://stderr', 100 ]
# Override monolog's 'filter_backtrace' processor to remove some redundant data (thus reduce data ingest)
# Remove the 'link' from context data as it makes sense only in Drupal's admin UI.
monolog.processor.filter_backtrace:
class: Drupal\monolog\Logger\Processor\ContextKeyFilterProcessor
arguments: [ [ 'backtrace', 'link' ] ]
shared: false