Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Incorporating Nigel docs

...

This section will show you how to access some of the basic error reporting functions in both Drupal and Fedora. 

 

Most components in the Islandora stack have their own log. This document will describe each of those logs: where they can be found; how to configure them; and what information they contain. Logs typically have "levels" which are used to determine what  kinds and how much information should be placed in them. A general rule of thumb is that a log will support the following levels in order of the most information to the least:

  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL

When you encounter a problem or are doing development you should check that the log is configured to store as much information as possible.

Error Reporting in Drupal

Drupal core/modules often display Drupal, PHP, and SQL errors are reported to the Drupal Watchdog logs. These logs can be accessed error messages to the end user in the browser as they happen. Often these messages will refer to a problem/action that occurred during the previous request. Most likely if you encounter a problem at this level, someone else has as well; its best to search google for relevant information. The issues are colour coded by seriousness, (red = error, yellow = warning, green = status/info).
Drupal also logs information to what it calls the 'watchdog'. The watchdog is essentially a database table, within the Drupal database. It contains messages generated by Drupal core/module code. You can view the 'watchdog' by visiting "http://yoursite/admin/reports/dblog" or by logging into your site, clicking the 'Administer' link (or navigating to http://URL.of.your.site/admin) and clicking 'Recent log entries' under 'Reports'. Errors are categorized by "type" which usually indicates which module generated the message.

You will see a list of recent log entries from various sources. Not all entries are errors - error messages will be marked with a red 'X'.

Clicking on a message description will give you a detailed summary of the error. You can use this information to troubleshoot a problem yourself, or to provide more detail to a technical support contact. 

Check the watchdog frequently even when the site is working correctly. Many non-fatal issues will be logged to the watchdog. Be proactive! Check the watchdog when:

  • An error message is displayed on the webpage.
  • The page appeared to work but something is missing or an action didn't take place.

Sometimes when working on a problem its useful to export the logs into a shareable format so that others in the community can help troubleshoot the problem. There are several ways to do this. If you have Drush installed you can dump the table like so:

Code Block
drush sql-dump --tables-list="watchdog" > watchdog.sql

Or you render the logs to a file:

Code Block
drush ws --count=1000 >watchdog.log

For more options to ws, use “drush help ws”. Since using “drush ws” doesn’t provide all the information in the watchdog its recommended that you use “drush sql-dump” for sharing.

You can import a dump watchdog log like so:

Code Block
drush sql-query "TRUNCATE watchdog;"; drush sql-cli < watchdog.sql

This will remove your local watchdog so be careful!

Error Reporting in Fedora

...

The most relevant log file in this directory is catalina.out. As with fedora.log, you can view this file in various ways; for example:

less catalina.out