By default, Drupal error logging happens to the log database (the watchdog table) and the screen. This is something I had overlooked for quite a while untill I stumbeled upon it while setting the error pages.
By default, Drupal error logging happens to the log database (the watchdog table) and the screen.
Error logging to the screen is quite ugly on a production site. Your visitors don't understand what's happening. It happend to me a few times on sites where I enabled page caching. The client notified me of the error messages so I disabled the caching without know I had the option to disable the error logging to the screen.
So how is this done?
The best solution for this problem is just to make sure you don't have errors in your site. That's utopia. But there's a better solution.
Go to Administer > Site configuration > Error reporting (admin/settings/error-reporting). There you have a dropdown list under 'Error reporting' with the two choices you have for the error logging, being:
The page even contains a hint to guide you in the right direction:
Where Drupal, PHP and SQL errors are logged. On a production server it is recommended that errors are only written to the error log. On a test server it can be helpful to write logs to the screen.
Just choose 'Write errors to the log.' and your visitiors won't be bugged by (to them) meaningless error messages.
Comments
You can find this in the variables table. The variable is called 'error_level'.
Davy,
Bedankt ;)
At our shop-- this was a big issue, because after repeated warnings, developers failed to turn logging to screen off on production sites. I'll certainly forward the link, FWIW. (Ah, developers!)
So I'm left with 100 production sites with logging to screen on, and developers... well, who have other things to do!-- but who I can't get to go do it manually.
For 48 hours or so, I've been trying to see where this is controlled in the database. Any ideas? Hints?
mvg,
Ken
There's a site for that ;)
http://www.drupal-check.org/
Hmmm.
PHP will also typically send out warning etc (depending on your loglevel) so this setting should really be "log only" on any production site, as this is all-but-unavoidable.
Perhaps we should write a basic "go to production steps" checklist on drupal.org?
It wasn't a coincidence! PHP had a fatal warning and therefore Drupal not only didn't send the warning, it also didn't send the rest of the page. Fixed by adding
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
to index.php (very beginning of file after ?php), seeing what the error was, fixing it, then removing the above code.
I'm sure it's coincidental and indicative of another issue, but when I set this to "logs only" and hit submit, my site went down. nothing but white screens no matter what query I send.
Damn.
Thanks!
It was useful.
Thanks...I must have glanced over that in the admin menu about a million times.
Post new comment