I'm trying to decrease the number of my queries with the devel module but I have two questions.

1) Why do I have 281 dblog_watchdog queries? How can I get rid of them? Why should I keep them, I already have the apache logs?

INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9)

2) How to show the number of queries for anonymous users? Right know it doesn't show anything.

  • 1
    Disable database log module, it will stop all watchdog queries. Its a PITA for big sites, and DB size will also increase. Check permissions page for granting permissions to anonymous user under devel section.
    – GoodSp33d
    Commented Nov 7, 2012 at 8:35

1 Answer 1


1) By default, dblog module is enabled. It is real performance bottleneck for big sites. But you can use syslog module (from core) or contrib analogs to write logs in /var/log/drupal.log and etc.
Rsyslog config can be something like this:

    local0.warning /var/log/drupal_site_err.log
    local0.info;local0.!warning /var/log/drupal_site.log

You should analize your logs and fix errors, warnings and even PHP notices. I think 281 messages per page — this is a lot.

2) On your dev site you can allow anonymous users to see devel information with permission “Access developer information”. Don't forget to disallow Devel on production.

  • I have a page on how to find the php errors that repeat the most first groups.drupal.org/node/170339 I run this query in something like phpmyadmin
    – mikeytown2
    Commented Nov 7, 2012 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.