Posted by electronicmonkey on
my site watchdog table is growing at the rate of 35MB per day even with a site that is very low traffic. It becomes a full time job to keep the size under control as the hosting company has a limit on database , which is quickly consumed by the watchdog table. Is there a way to turn watchdog off without any harm done to the site ?
Comments
Sure, you can disable the
Sure, you can disable the "Database logging" module under the Core - Optional group on the module administration page. As it is an "optional" module your site will run fine without it.
Thanks, this is a better
Thanks, this is a better alternative for me. Don't know why I turned it on initially. It keeps making my site unuseable every three days. Limiting number of rows don't work even with cron fully on.
Configure watchdog
You can configure how many watchdog rows are kept...
http://drupal.org/documentation/modules/watchdog
Make sure cron.php is being run in order to execute the clearout.
来自 https://www.drupal.org/node/1265500
disable watchdog
how can i disable watchdog? or stop logging?
- Log in or register to post comments
-
⋅ Categories: Drupal 4.6.xComments
Why?
Watchdog is a required module. Logging is always a good idea.
Why do you want to disable logging? Perhaps the problem you have (?) can be solved in another way.
--
Tips for posting to the forums
--
The Manual | Troubleshooting FAQ | Tips for posting.
the problem is
watch dog logs every move to the sql. so it writes on hdd everytime... for a faster system i want to test drupal without watchdog...
Does it?
I believe watchdog only logs user logins/logouts/registrations, adding new content certain other messages, but not 'every move'. Access logs are kept by the statistics module.
How many users does your site have that logging is a problem?
Anyway you can comment (//) db_query(args) from
in bootstrap.inc
PS It's not a good idea to disable watchdog. Do something on the hardware side...
--
Tips for posting to the forums
--
The Manual | Troubleshooting FAQ | Tips for posting.
works in drupal 5.10?
what part would I comment out in drupal 5.10? The code in that section is slightly different.
Why and How
Why:
You have access to your web server (Apache) logs and know your way around them. If you familiar with Apache's error log than you will be frustrated by the fact that you will end up with half your PHP issues in Watchdog and the other half in your error log. Why not just keep them all in one place (error log) that requires no database overhead and is, in my opinion, easier to read? Watchdog also logs all 404 errors, which also get logged in Apache's access log...so you avoid data duplication and more overhead.
How:
It will require committing the cardinal sin of hacking Drupal core...OH NO!!
First, we will disable Drupal's error_handler function by commenting out the following line in _drupal_bootstrap_full around or on line 1967 in common.inc:
set_error_handler('error_handler');
Then, find your watchdog() function in bootstrap.inc (around or on line 747) and add in the following switch statement in place of the db_query() call:
Hmm, how about setting our own error handler in settings.php?
After looking set_error_handler I learned from the comments that I could use this code in my settings.php:
It works for PHP errors at least, since I can see the error handler taking control.
In 6.x in moduels/dblog.module the dblog_watchdog function can be completly commented out after function and until before the last closing curly brace, like this:
Which seems to work for me under xampp on osx.
Of course, the best option would be to change the dblog_watchdog function to write the log to a file, or to syslog, as per the same for php_errors.
There might be some way to hook into dblog_watchdog, so that you don't have to hack a core file.
Paul K Egell-Johnsen
Seems to work on production site as well
The page requests became much more snappy after disabling the watchdog.
Paul K Egell-Johnsen
interesting
following this, as one of our developers was curious about this too.
hands tied
what happened to the follow bottom. I hate to post on this with nothing to add, but since there is no follow button, I have my hands tied.
Disable drupal error handler in debug module
Hi, I have drupal version 7.28 and with module devel you can totally disable Drupal error handlers.
Simply go to Settings of module Devel and set Error handlers option to none.
After that every PHP notice, warning, errors and fatal errors are logged in standard way to error.log file.
来自 https://www.drupal.org/node/38613