Map LoggerChannel Constants to PSR-3 rather than to RFC 5424

Created on 17 June 2019, almost 5 years ago
Updated 6 May 2024, 27 days ago

Drupal's LoggerChannel unexpectedly maps the PSR-3 LogLevel constants(strings) to a separate set of constants based on the RFC-5424 levels(integers) before passing the level to the log method on the implementation of LoggerInterface. This reduces interoperability with external loggers and is not well documented. All PSR-3 compliant loggers should support the LogLevel constants provided by the PSR-3 reference implementation; other levels can be supported, but they should be in addition to the core levels.

I would suggest fixing this by mapping in the other direction, from the RFC log level constants to the PSR-3 log level constants. This will allow any standard PSR-3 compliant logger to work with Drupal without modification while allowing existing code that references Drupal-specific log levels to function correctly. Some existing logging modules may need updating to support the standard PSR-3 levels.

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 2 hours ago

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024