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

Conversation

k4lv15
Copy link

@k4lv15 k4lv15 commented Feb 18, 2025

Adjust the default monolog channel handler:

  • set formater to JSON to have structured Drupal logs
  • specify default log processors
  • override monolog's filter_backtrace processor to remove redundant log data which makes sense in Drupal UI but not on stderr

… monolog's default channel handler, override filter_backtrace processor to remove redundant data from logs, improve comments in silta.services.yml
@Jancis
Copy link
Member

Jancis commented Feb 26, 2025

Works as expected, can see structured log picked up by otel and displayed in logging system.
Not excited that the log format is json by default, but worth it if it makes it easier for developers to navigate logs.

@Rade333 Rade333 requested a review from Copilot March 11, 2025 09:00

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

A PR to update the monolog channel handler configuration to format Drupal application logs as structured JSON and optimize log data by overriding the "filter_backtrace" processor.

  • Change the configuration from a simple stream handler list to a structured dictionary including formatters and processors.
  • Override the "filter_backtrace" processor to exclude the "link" context, reducing redundant log data.

Reviewed Changes

File Description
charts/drupal/files/silta.services.yml Updates handler configuration and processor override

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

charts/drupal/files/silta.services.yml:3

  • Please verify that changing the 'monolog.channel_handlers' value from a list to a dictionary structure does not break existing references or expectations in the codebase.
default:

charts/drupal/files/silta.services.yml:24

  • Confirm that overriding the 'filter_backtrace' processor with a non-shared instance meets the intended logging behavior and does not lead to unexpected processor lifecycle issues.
monolog.processor.filter_backtrace:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants