OK, I'm clearly missing something about how error logging is supposed to work. This is a D7 production site, so my goal is to get errors written into a log file, but not show up on the screen. I've added the following to the end of my site's settings.php file:
error_reporting(E_ALL); // just to get going; I'll scale this back later
ini_set('display_errors', 0); // don't display errors on the screen
ini_set('log_errors', 1); // log errors...
ini_set('error_log', 'syslog'); // ...in the syslog (I'm running this on Fedora 15,
// so I think this should work (although I'd happy to
// have the logging happen somewhere else
My reading of all the docs makes me think that this should work, but when I put the following into a module file as a way of forcing some errors:
$x = 1 / 0;
$foo = $bar + $baz;
I still get the divide-by-zero warning and the undefined variable notices coming up on the screen via drupal_set_message, and comparable messages in watchdog. If I instead do error_reporting(0)
, I get nothing on the screen, and nothing in watchdog. In no case do I see any messages showing up anywhere in /var/log.
I'm clearly doing something wrong, no? Can anyone see what it is?