Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

apache error_log

Posted on 2006-10-20
10
Medium Priority
?
794 Views
Last Modified: 2012-08-14
hello,
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?
thanks
0
Comment
Question by:Sabrin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 2

Expert Comment

by:harshgrover
ID: 17775569
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".

Gary
0
 
LVL 9

Expert Comment

by:shinobun
ID: 17776617
Haven't tried it, but this should work on *NIX systems:

ErrorLog /dev/null
0
 
LVL 2

Expert Comment

by:harshgrover
ID: 17776705
does not work on windows based systems. it creates a file null in the logs folder. not sure about *NIX though
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Sabrin
ID: 17777384
yes i have a CentOS v4.4 server
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17780807
Any special reason you do not want an error log?  How do you plan to trouble shoot anything if there are problems?
0
 

Author Comment

by:Sabrin
ID: 17780908
If I get any error from the browser ill fix it!
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17784499
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.
0
 
LVL 13

Accepted Solution

by:
Caseybea earned 2000 total points
ID: 17790484
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 ..."
0
 

Author Comment

by:Sabrin
ID: 17799335
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
0
 
LVL 13

Expert Comment

by:Caseybea
ID: 17803748
Yep :-)
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question