How to divide watchdog logs depending on type in Drupal 6

Let’s say we want to redirect the php errors inside watchdog to php_error.log and the rest to drupal.log.

its useful to distinguish between php errors and Drupal events.

You only have to add this function to a new module:

* Implements hook_init().
* Drupal sets an error handler that sends PHP errors to watchdog. Undo that.
function mymodule_init() {



or if you have the module Devel installed you only need to go to /admin/settings/devel


and select NONE in the Error handler section.


Screen Shot 2013-07-16 at 17.10.07


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s