homepage Welcome to WebmasterWorld Guest from 54.204.182.118
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Disabling access logs in httpd.conf
teasers

10+ Year Member



 
Msg#: 3625505 posted 8:42 pm on Apr 12, 2008 (gmt 0)

Hi there,

I don't want Apache to write access logs, so I made a change like this:

#CustomLog logs/access_log combined
CustomLog /dev/null combined

..and also commented out CustomLog directives in Virtual Hosts.

I think that will prevent Apache to write the log files, but the problem is it will still use cpu resources, am I wrong there?

If that's the case, will something like this work?

LogFormat "" combined
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

What I'm using here is an empty log format:

LogFormat "" combined

but on a really old forum (of about 10 years ago) :) a guy said it won't work?

What do you think?

 

teasers

10+ Year Member



 
Msg#: 3625505 posted 5:40 am on Apr 13, 2008 (gmt 0)

Opps...

# /etc/rc.d/init.d/httpd start
Starting httpd: Syntax error on line 485 of /etc/httpd/conf/httpd.conf:
LogFormat takes 1-2 arguments, a log format string (see docs) and an optional format name

nope... I think I will add at least 1-2 arguments there..

teasers

10+ Year Member



 
Msg#: 3625505 posted 3:44 pm on Apr 14, 2008 (gmt 0)

I have changed it as:
LogFormat "%h" combined

and using:
CustomLog /dev/null combined

It's OK now.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3625505 posted 1:37 am on Apr 15, 2008 (gmt 0)

I don't think I've ever seen anyone want to disable their logs completely before... :)

But thanks for posting your solution.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved