viewing drupal logs from CLI

From thelinuxwiki
Revision as of 12:03, 9 April 2019 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

==problem== viewing drupal logs without using the web interface or drush

drupal logs are kept in the backend database,so we can pull them from there.

solution

(optional) create a database user just for viewing

example from mysql shell

mysql> GRANT SELECT ON 'my_database_name'.* TO 'my_username'@'localhost' IDENTIFIED BY 'mypassword';

view watchlog logs

mysql -h localhost -u my_username my_database_name -e "select hostname from watchdog " --password=my_password