News:

Wondering if this will always be free?  See why free is better.

Main Menu

Auto clear logs / truncate

Started by Suicide Bomber, June 13, 2008, 10:42:34 PM

Previous topic - Next topic

Suicide Bomber

I was wondering if there was any way to either automatically clear out the logs and / or truncate logs after a certain size. Recently our forums were working oddly sluggish, the database exceeding 2 gigs. Clearing out the logs reduced this to 71 MB and improved the speed of the forums dramatically.

Is there any existing way to automatically clear unimportant / error logs?


edit:

simply disabling error reporting works fine for me

青山 素子

Quote from: Suicide Bomber on June 13, 2008, 10:42:34 PM
I was wondering if there was any way to either automatically clear out the logs and / or truncate logs after a certain size. Recently our forums were working oddly sluggish, the database exceeding 2 gigs. Clearing out the logs reduced this to 71 MB and improved the speed of the forums dramatically.

Is there any existing way to automatically clear unimportant / error logs?

Version 2.0 will have a scheduled task that will automatically purge log entries older than a time you set. It's not there in 1.1.x or below, but you should be checking your logs reguarly. Errors mean there is (or was) an issue and should be dealt with.


Quote from: Suicide Bomber on June 13, 2008, 10:42:34 PM
simply disabling error reporting works fine for me

Bad idea, but it's your board.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


dschwab9

2 gigs is by no means a big database, but if it went from 71 megs to 2 gigs due to the error log, I would definitely investigate those errors.  It sound like you probably have tons of errors being generated on every page view, and all of those being inserted into the database is probably what's causing the slowdown, not necessarily the size of the database.

Suicide Bomber

#3
Quote from: dschwab9 on June 16, 2008, 03:30:56 AM
2 gigs is by no means a big database, but if it went from 71 megs to 2 gigs due to the error log, I would definitely investigate those errors.  It sound like you probably have tons of errors being generated on every page view, and all of those being inserted into the database is probably what's causing the slowdown, not necessarily the size of the database.

The logs have not until recently been cleared that I can remember since the forums start last summer, but I don't doubt that the errors need to be fixed, but I don't know how to go about that:


8: Undefined index: url
/home/taconban/public_html/tnbforums/Sources/Load.php(1726) : eval()'d code
282


2: include() [<a href='function.include'>function.include</a>]: Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')
/home/taconban/public_html/tnbforums/Sources/Load.php(1726) : eval()'d code
282


8: Use of undefined constant Home - assumed 'Home'
File: /home/taconban/public_html/tnbforums/Themes/default/languages/ModSettings.english.php (main_above sub template - eval?)
Line: 316


This is a large board (based on activity), and these errors are reoccuring for every page load. Logs have been enabled for no longer than 3 minutes now, and there are in excess of 20 pages of forum error logs

Rumbaar

Are they the only errors you are getting?

Can you post what is on line 282 of your Load.php file

This is an eval error too, the error might not even be in that file.

you'll have to disable template eval temporarily to get the real file and error line.

To do this, run this query in PHPmyAdmin (What is phpMyAdmin?)

INSERT INTO smf_settings VALUES ('disableTemplateEval', 1);

Once that's done, get the error again and copy it (the file and line may have changed), then run this query to re-enable it:

DELETE FROM smf_settings WHERE variable = 'disableTemplateEval';

Once you get that new error location, can you post what is on the mentioned line.  Most likely it will be in the themes index.template.php file for the 'home' button.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: