Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a php website running on lighttpd. I have around 15 to 30k visits daily. Now, in my PHP code, I have a lot of warnings generated by undeclared $_GET or $_POST variables.

Obviously these are not shown to the user so are all logged into lighttpd log tiles.

Problem is: every 3 or 4 days those logs get so big that basically take up all the space in the system and can't do anything else, sessions stop working, etc.

How can I prevent lighttpd from writing up all those warning messages?

share|improve this question

1 Answer 1

You coult turn off logging php errors.
See http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors

Or you could use some log rotation mechanism to compress each day's log and delete logs that are older than two or three days.
See http://linux.die.net/man/8/logrotate

share|improve this answer
    
I would opt for turning off logging PHP warnings and notices, only errors logged. Logrotate doesn't actually help much on highly trafficated and error-plenty applications, at least if the HD is clogged in 3 or 4 days (I had a site, hit by Google indexer, that clogged the 30GB Azure VHD in 1 hour because of one damn script) –  djechelon Feb 5 '13 at 14:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.