Add support to write ELT log on standard output (stdout)

Created on 23 May 2024, 4 months ago
Updated 2 July 2024, 3 months ago

Problem/Motivation

Projects running drupal in virtualized environments (Docker) can delegate logs management to the infrastructure.
To do this, drupal logs must be written directly to the container's standard output (stdout).
The drupal community provides a contrib module to do this: log_stdout β†’ .
The log_stdout module works like the core:syslog module, but instead of sending logs to a syslog server, it sends them to the standard output.
ELT supports syslog (via event_log_track_syslog sub-module), but does not support stdout.
The aim is to enable ELT to support stdout.

Steps to reproduce

No steps to reproduce.

Proposed resolution

- Add event_log_track_stdout sub-module : Provide support to write ELT log on php://stdout or php://stderr for better log handling with Docker. See modules/event_log_track_stdout/README.md
- hook_token_info() and hook_tokens() are moved from the event_log_track_syslog module to the event_log_track module. This is to mutualize the code used by the event_log_track_syslog and event_log_track_stdout sub-modules.
- hook_event_log_track_alter() is triggered earlier in the event_log_track_insert() function. This allows other modules to modify the log before it is written, regardless of its destination (syslog, stdout or database).
- The schema of the event_log_track.settings config is modified: Items concerning syslog and stdout are grouped in mapping object. The event_log_track_update_9405() method is used to recover existing syslog configurations.

Remaining tasks

No remaining tasks.

User interface changes

The administration interface of the log_stdout module (admin/config/development/log_stdout) is modified by the event_log_track_stdout module to add ELT log configuration.

API changes

Please note : hook_event_log_track_alter() is triggered earlier in the event_log_track_insert() function.

Data model changes

No data model changes.

✨ Feature request
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡«πŸ‡·France aurm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024