The Recent log messages report is probably the most commonly used of the reports available in Drupal core. Any module is able to report its activity here in a standardized way, whether it is for error reporting or simply informational details.
Click on the Recent log messages link, and you'll see a report similar to this:
Due to the fact that any module can insert messages here, the display can be a little confusing. Each log entry has the following fields:
Sometimes, there is more detail to a log entry than the summary report is able to display. Clicking on the message opens up another page with more log details:
This provides the following additional information that was not on the summary page:
When you have a number of modules operating on your Drupal site, it can be difficult to find the messages in the report that you are looking for. On the reports page, there is a filter system to help with this:
This will allow you to only show messages for a specific type (for example, just for one module) and specific severity. This is a quick way to reduce the number of entries, so you are only presented with what you are looking for.
For example, to check for login attempts, select user from the Type menu, Notice from the Severity list then click the Filter button:
The resultant filtered report may be as follows:
This will show you only the log records of interest. Click on the Reset button at any time to clear the filter and display the full list.
Each log message is stored in the Drupal database, up to a limit defined in the site configuration. It is unwise to store all messages forever, due to the potential amount of data and therefore database size. 1000 messages is a sensible default.
To clear the current list, go back to the main reports screen by navigating to Manage | Reports | Recent log messages.
Expand the CLEAR LOG MESSAGES section:
This has one simple function—Clear log messages—which will permanently delete all log messages from the database. By default, the maximum number of messages is set to 1,000; to change the setting go to:
Manage | Configuration | Development | Logging and errors:
Recording so much data to your database can have an impact on the performance of your site as it gets busier. For this reason, there is an alternative module in Drupal 8 core called Syslog
. Once enabled, Syslog
will record exactly the same information that we have been looking at so far into the server log files rather than the Drupal database. This is a significantly faster process, if slightly less convenient for you to access as the site administrator.