apache error_log

how can I prevent apache from making this file /var/log/httpd/error_log
i dont want to store that log! anyway to disable it?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

CaseybeaConnect With a Mentor Commented:
Rather than NOT create a log file, (but knowing you don't seem to want a large log file), I'd recommend the following:

ErrorLog   /var/log/httpd/error_log
LogLevel   crit

What this does is it will create the log file, but will ONLY log "critical" log messages and higher.    Critical errors are things like Apache not being able to utilize a network socket, etc.   It will NOT show lesser errors (like HTTP syntax errors in the web page).

For reference, the log levels are as follows.  Note, the further down this list you go, the more "verbose" your error log will be.     For example, LogLevel Debug logs *everything*.      Loglevel "emerg" logs next to nothing unless your apache server is toast.     All others are somewhere in-between.

Apache.org highly recommends at LEAST logging level "crit".

Level     Description  Example  
emerg   Emergencies - system is unusable. "Child cannot open lock file. Exiting"
alert     Action must be taken immediately. "getpwuid: couldn't determine user name from uid"
crit       Critical Conditions. "socket: Failed to get a socket, exiting child"
error    Error conditions. "Premature end of script headers"
warn    Warning conditions. "child process 1234 did not exit, sending another SIGHUP"
notice   Normal but significant condition. "httpd: caught SIGBUS, attempting to dump core in ..."
info       Informational. "Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers)..."
debug  Debug-level messages "Opening config file ..."
it wont be possible to disable logging at all. however you could change where the file is logged, using the errorlog directive, and then you could limit the logging to absolute minimum by changing the loglevel directive to "crit".

Haven't tried it, but this should work on *NIX systems:

ErrorLog /dev/null
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

does not work on windows based systems. it creates a file null in the logs folder. not sure about *NIX though
SabrinAuthor Commented:
yes i have a CentOS v4.4 server
Any special reason you do not want an error log?  How do you plan to trouble shoot anything if there are problems?
SabrinAuthor Commented:
If I get any error from the browser ill fix it!
The Apache error log show you why you get errors on the sever.  All the browsers do is say "something is broke".  The error log tells you what is broke.  For instance, an HTTP 500 error is what a browser will show when the http sever encounters many different type of errors. The cause of the 500 is only in the Apache error log.
SabrinAuthor Commented:
change this code from httpd.conf to crit ?

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#ErrorLog directive is moved to httpd20_app.conf

# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
Yep :-)
All Courses

From novice to tech pro — start learning today.