Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My disk space usage is increasing very fast because of the logs. Everyday I get ~1.5 GB log file. How can I disable that?

share|improve this question

migrated from Mar 20 '11 at 8:48

This question came from our site for professional and enthusiast programmers.

What is being logged that's taking up all that space? Is something logging full debugging info when it should only be logging errors? Is something failing horribly and trying to get your attention? – David Mar 19 '11 at 12:27
Assuming you are talking about the error log, how about fixing the errors instead of pretending they are not there? – Gordon Mar 19 '11 at 12:31
Please clarify "the logs". Which logs? Apache Logs? Access Logs? Error Logs? PHP logs? – Gordon Mar 19 '11 at 13:17
up vote 3 down vote accepted

Disabling logs is never a good idea. You can use programs like logrotate to rotate your log files if the space is the issue. If you insist on not keeping log files. Please direct your program's log directive to /dev/null

share|improve this answer

firstly try to minimize errors then if that fails

 ini_set ('log_errors',false);
share|improve this answer
@Lawrence Cherone: I should add this line in header.php? – hey Mar 19 '11 at 12:29
anywhere before the errors can occurs, fix errors first tho, debugging is half the fun of php :/ – Lawrence Cherone Mar 19 '11 at 12:31
info regarding error logging can be found here – Lawrence Cherone Mar 19 '11 at 12:35

PHP Logs can become an annoyance when you're stuck in an environment you don't own, you're writing a CLI script real quick, and the log output insists on going right to the command line. It would be nice if there were a quick answer like:

ini_set('error_log', '/dev/null');

Oh wait, that does work.

share|improve this answer

Since this is probably not about PHP, check out the Apache settings

LogLevel error

Will hide warnings, and debug messages. Can be set per vhost. The next higher level would be crit, but is inadvisable.

share|improve this answer

Your Answer


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.