Sort out @backtrace_string logging by Syslog module

Created on 10 February 2023, almost 2 years ago
Updated 10 November 2023, about 1 year ago

Problem/Motivation

Should backtraces be logged by Syslog module? Syslog seems historically oriented around short log messages, and by default (as of PHP 7.3 and later), a new syslog message is created when a newline is encountered. Note, the syslog.filter PHP setting can be configured to not split syslog messages at newlines, see https://www.php.net/manual/en/errorfunc.configuration.php#ini.syslog.filter

If backtraces should be logged by Syslog, this is currently missing from some important places. For events logged by ExceptionLoggingSubscriber, watchdog_exception() and friends, which do not include it in the log message, it could be pulled from the context array.

If backtraces should not be logged by Syslog, we could remove @backtrace_string from the log message in core/includes/errors.inc and core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php

If desired, we could also add a config toggle to choose between not logging the @backtrace_string or pulling it from the context array.

Steps to reproduce

Throw an exception from a controller method, or log it using watchdog_exception(); syslog will not log the @backtrace_string.

Proposed resolution

To be determined.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
SyslogΒ  β†’

Last updated 4 months ago

  • Maintained by
  • πŸ‡¦πŸ‡·Argentina @dagmar
Created by

πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

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.

  • Issue created by @mfb
  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    Add mention of PHP syslog.filter setting to issue summary (allows syslog messages to not be split at newlines).

Production build 0.71.5 2024