---
title: "Drupal watchdog log messages"
date: "2022-02-11T06:05:40+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92906-drupal-watchdog-log-messages"
id: "5d776f0d-4895-4407-9dd8-3ae2e60b187f"
---

Table of contents will be added

Issue
-----

How do I use the Drupal Watchdog log to troubleshoot?

Resolution
----------

Note

Although this troubleshooting guide is intended for Acquia Cloud users, the information in this article may be helpful regarding websites hosted on other platforms.

The Drupal watchdog log records Drupal-related actions on your Drupal website. On Acquia Cloud, it contains data from all of your website's servers. You can download the most recent watchdog logs from the **Cloud > Logs** page. For more information about how to do so, see [About Acquia Cloud logging](/node/56379).

If you're using another hosting platform, by default Drupal places the watchdog log at `http://[site_URL]/admin/reports/dblog`.

Finding a specific page
-----------------------

If you're experiencing issues with a certain webpage on your website and need only the watchdog log messages for that particular webpage, you can obtain those messages with the following steps:

1.  Add a query string to the webpage's URL in your browser's address bar to make it unique, and to ensure that the web server will build a fresh page when receiving the request.
    
    For example, if you want to debug this URL:
    
        http://www.example.com
    
    add a query string (such as `?x=1234`) to the end of the URL:
    
        http://www.example.com/?x=1234
    
2.  Search your Apache access log for the query string that you used in the previous step.
    
    Note
    
    For each server, the Apache access log file is located at `/var/log/sites/[site].[env]/logs/[servername]/[logname].log`.
    
    You can find `[site]` on the **Cloud > Users and Keys** page, and `[servername]` on the **Cloud > Servers** page.
    
    For example, the Apache access log for the Prod environment of a site named `example` on a server named `srv-25` would be:
    
        /var/log/sites/example.prod/logs/srv-25/access.log
    
    1.  Connect to your server using the `SSH` command.
        
            ssh example.prod@srv-25.devcloud.hosting.acquia.com
        
    2.  Change to the correct directory:
        
            /var/log/sites/example.prod/logs/srv-25
        
    3.  Use the following command to return the watchdog log messages for the website named `example`.
        
            grep "?x=1234" drupal-watchdog.log
        
3.  If you need to search in these results, use the `grep` command again, like this:
    
        grep "?x=1234" drupal-watchdog.log | grep "something else"
    

Finding by request id
---------------------

If you have a particular request that seems to take an excessive amount of time to complete, you can search for it in the `watchdog.log`

### Current day

You can `cd` into your logs directory and use the UNIX `tail` command to review the log as it processes, like this:

    tail -f drupal-watchdog.log

If you tail the log while loading a page, you should see a line that contains a `request_id`. After you have the `request_id`, you can search the log with grep, which will display all of the log files this `request_id` touched.

    grep <requestIDhere> *.log

### Previous days

Logs from previous days are gzipped. If you want to search through a gzipped log, you can do that with a command similar to the following:

    zgrep <string> <logfile.gz>

After you have it, and you know what day you're searching for, you can zgrep through all of the gzipped files for that day, like this:

    zgrep <string> *<date-filename>.gz

Memory consumption
------------------

Because excessive memory consumption can cause serious performance issues, you can also use the watchdog log file to help you determine where memory is being used excessively. For details about the [Memory Profiler](https://drupal.org/project/memory_profiler) module and how to use it effectively to do this, see [Logging using the Memory Profiler module](/node/92081).