drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.33k stars 1.08k forks source link

Add backtrace to `watchdog:show-one` #6065

Closed andriokha closed 2 months ago

andriokha commented 2 months ago

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.

weitzman commented 2 months ago

Lets close this and keep working in the PR #6066