欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

watchdog table grows too big too fast

shiping1 的头像

On a rather busy D6 site, I need to truncate watchdog table very frequently, since it grows at about few Gigabyes per day. On the other hand I can not disable access logs to avoid the table's inflation. Running cron yeilds a lot of errors and does not seem to clean watchdog table. So what is the best way to deal with this problem?

Thanks

shareimprove this question
 
1 
what kind of messages are filling it up? what kind of errors is cron spitting out? –  Jimajamma Mar 22 '12 at 0:06
   
If there are errors thrown there. Try solving them may be even notices. This will make ur site even faster. – Hacker Mar 22 '12 at 8:15 

Without knowing what kinds of errors you are seeing, it is hard to say what to do. If this is a live site, then I suggest that you edit your settings.php to turn off PHP error reporting. IIRC, this will do it for you

error_reporting(0);
ini_set('display_errors', FALSE);
ini_set('display_startup_errors', FALSE);

or you could also edit your php.ini and do the same thing, or use the equivalent .htaccess directives. You may get by with just turning off E_NOTICE.

If you are seeing favicon.ico errors in the in the log, then I suggest putting in a rewrite to point to the favicon in your theme, or at least on in one of the standard themes.

Another possible watchdog clogger are the internal connection messages. You can try adding

# make sure internal dummy connections don't make it into drupal
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]

to .htaccess if you are seeing them.

All of this said, if you are seeing several gigs of errors or warnings in your watchdog, then you have aserious problem with your site. Clone the site to a development version, and figure out what is really going on: fix the actual problem (ie, stop the errors) instead of curing a symptom (ie, hiding the error messages).


来自 http://drupal.stackexchange.com/questions/26180/watchdog-table-grows-too-big-too-fast
普通分类: