Skip to content

Add backtrace to watchdog:show-one #6065

Closed
@andriokha

Description

@andriokha

Is your feature request related to a problem? Please describe.
When an exception is logged to the dblog by \Drupal\Core\EventSubscriber\ExceptionLoggingSubscriber::onError() or \Drupal\Core\Utility\Error::logException(), there is no backtrace shown when using watchdog:show-one and it is very difficult to find the problem in code.

Describe the solution you'd like
Display the backtrace as a separate field.

Additional context
The reason the issue exists is because the log message doesn't by default contain the @backtrace_string placeholder (\Drupal\Core\Utility\Error::DEFAULT_ERROR_MESSAGE is %type: @message in %function (line %line of %file).). The issue was fixed in Drupal 10.2 and 11.x here where they opted to add a new backtrace row.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions