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.

Is there an easy way to prevent IIS from logging hits to static content (*.jpg, *.css, etc.), or do I have to rewrite it out manually or code a custom log provider that does this?

I already remove the logging on a per-directory basis in some cases, but it would be nice to be able to disable logging for whole classes of static files on a serverwide basis (i.e. in applicationHost.config)

Thanks for any ideas

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Not that I know of. As a security best practice, everything happening on the server should be logged. This can also help with load/traffic analysis.

You could simply ignore the static file entries in the log files, which would be much less work?

share|improve this answer
    
Yes good call I know. I will have to use the logparser-based rewriter I already wrote I suppose. The issue is the WebTrends analytics server on the backend-- it licenses by lines of input, so straining out static files can save a lot of hits. –  asteroid Mar 7 '12 at 14:15
    
I suppose we could do static file caching differently (i.e. split to separate DNS name) and just not log hits to that static content CDN-type domain, minus the security implications you mention of course... –  asteroid Mar 7 '12 at 14:16
    
(other than lacking logs) I like the idea of using a static.example.com host for that. –  TristanK Mar 8 '12 at 2:30
add comment

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.