Drupal coder

logging

Run cron if you use the watchdog

It seems like a lot of people forget about this. Maybe because they don't know how to set up a cron. But if you use the watchdog, and you want to periodically discard your old log entries (admin/settings/error-reporting), you should also set up your cron.

If you don't know how to do this, read the Drupal cron documentation.

If you're using Drupal 6, you might consider using Acquia's Drupal distribution which enables cron by default from their servers.

And if you don't have access to set the cron on your server, Poormanscron is a great alternative.

October 15, 2008Drupal, logging, performance

Configure how long your log messages need to be kept in Drupal

By default Drupal discards your log entries older then one week. This is done to keep your database small and sharp by throwing out irrelevant log messages.

But sometimes you just want your log messages to be discarded at all. You can override Drupal's default behaviour by altering a setting in the administration section.

Go to Administer > Site configuration > Error reporting (admin/settings/error-reporting).

You will find a setting there saying 'Discard log entries older than'. Well, that was what we were looking for :)