I want to log only CRON TYPE and SEVERITY NOTICE message in db log , want to exclude all other types like notice, alert, critical, info, debug etc., Is there any way to prevent this, or should i write any custom coding for this? if custom coding for where i can prevent logging other types in DBLOG.

1 Answer 1


The Drupal error handler _drupal_error_handler_real() utilized PHP's error_reporting() to determine what gets logged to the DB. By setting the PHP error_reporting to E_ERROR it will only PHP errors.

This PHP setting can be set in many places: the system php.ini, a php.ini/.user.ini instance in webroot, .htaccess in Apache. The Drupal centric way to do this, is to use ini_set() function in settings.php:

ini_set('error_reporting', E_ERROR);

See PHPs error constant page for other values to set error_reporting.

  • I want to log all these in DB log like CRON TYPE and SEVERITY NOTICE, not other messages. Updated Question can you kindly check this.
    – Ajay Reddy
    Commented Oct 15, 2016 at 2:02

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.