How can I check Drupal log files?

Solutions

If you love the command line, you can also do this using drush with the watchdog show command:

drush ws

More information about this command available here:

https://drushcommands.com/drush-7x/watchdog/watchdog-show/

To view entries in Drupal's own internal log system (the watchdog database table), go to http://example.com/admin/reports/dblog. These can include Drupal-specific errors as well as general PHP or MySQL errors that have been thrown.

Use the watchdog() function to add an entry to this log from your own custom module.

When Drupal bootstraps it uses the PHP function set_error_handler() to set its own error handler for PHP errors. Therefore, whenever a PHP error occurs within Drupal it will be logged through the watchdog() call at admin/reports/dblog. If you look for PHP fatal errors, for example, in /var/log/apache/error.log and don't see them, this is why. Other errors, e.g. Apache errors, should still be logged in /var/log, or wherever you have it configured to log to.

Make sure drush is installed (you may also need to make sure the dblog module is enabled) and use:

drush watchdog-show --tail

Available in drush v8 and below.

This will give you a live look at the logs from your console.

Tags: Drupal / Drupal 7

Similar questions

Writing log files in disk instead of db in drupal
Is there a way (or a module) to write log files into the disk instead of writing them to db? Because i really don't want my db getting fatter just because log lines.
How to log simpletest test results into files using drush test-run?
I would like to save simpletest test results into a log file. What bash commands should I use ? I tried this command (example) but nothing is saved into /var/tmp folder : I use Linux , Drupal 7.12, Drush 4.5
how to log downloaded files
I have a content type with a (private) file field. Content is protected by a node access module. I would like to log (in a particular way) when a user is about to download a file. hook_file_download looks like it will do the trick, but on the other hand, its stated purpose is to "control access". I'm letting Drupal Core control access; I just want ...
How can I check that the file is present in database entry and also in files folder?
I want to write a script where I want to check whether the files are present in files folder of drupal/sites/default/files and is it existing in the database table file_managed. i am not able to find any way to get the fields delete.
Edit user account how to check before update if the role check box is selected?
I have a module that when my user changes the user details hook_user onupdate, pushes these details to an external database. However I would like this to only work when role X is selected, else my module will not do anything. The role will not be in the users profile as this processing is happening before I update the users account. Drupal 6 Thanks...
With a WSOD upon deployment of a site, should I first clear the cache, check watchdog logs, or check the Apache logs?
With a WSOD upon deployment of a Drupal 8 site, should I first clear the cache, check watchdog logs, check the Apache logs, or something else? I read the Drupal WSOD triage information here But it doesn't seem to share which solution should first be done in this situation. This seems to indicate that it could be with the DB, so would I need to chec...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.