drush icon indicating copy to clipboard operation
drush copied to clipboard

`watchdog:show` silently ignores `username` column

Open GuyPaddock opened this issue 3 years ago • 0 comments

Describe the bug It does not seem to be possible to get the username column to appear in exports from watchdog;show.

To Reproduce

  1. Run drush watchdog:show --format=json --fields=username --count=2500.
  2. Run drush watchdog:show --format=json --fields=wid,username --count=2500.
  3. Run drush watchdog:show --format=csv --fields=username --count=2500.
  4. Run drush watchdog:show --format=csv --fields=wid,username --count=2500.

Expected behavior In all three cases, the "Username" field should be populated.

Actual behavior The behavior varies by what other fields are included:

  1. With JSON output, asking for just the username causes the JSON to be returned with an empty username field in all the results.
  2. With JSON output, asking for any field alongside the username causes the username field to be omitted.
  3. With CSV output, asking for just the username causes blank lines to be returned for all rows.
  4. With CSV output, asking for any field alongside the username causes the username field to be omitted (not even the heading is present).

Workaround Is there another way to do the desired action? Not to my knowledge.

System Configuration

Q A
Drush version? 10.6.2
Drupal version? 9.3.21
PHP version 7.4.30
OS? Linux

Additional information Reproducible on Pantheon as well as in Lando with the Pantheon recipe.

GuyPaddock avatar Aug 05 '22 23:08 GuyPaddock