We help IT Professionals succeed at work.

move inetpub log files

yballan
yballan used Ask the Experts™
on
Dear Experts,

I have been looking to find how to move inetpub log files to a different location from the current.
I also wanted to know the importance of these files.   Do I need to keep all histories, or just recent ones?
Thank you in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
try this

http://blogs.iis.net/thomad/archive/2008/02/10/moving-the-iis7-inetpub-directory-to-a-different-drive.aspx

%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"F:\inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"F:\inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"F

Author

Commented:
Thank you, I tried the batch file on the website, and it said it finished successfully.
few more questions, do I need to keep all of those past log files?  When do I need them?
Should I be routinely deleting them?
As long as you don't have a disk space problem you can keep them to run analysis. Here's some examples of what you could pull out of them.

If you are monitoring traffic you might to run queries from month to month or even year to year. Personally I prefer the logs on Google Analytics - http://www.google.com/analytics/ & Statcounter -http://statcounter.com/  but IIS logs may be useful to you.

If you have space issues you coudl archive them to DVD.

http://blogs.iis.net/carlosag/archive/2010/03/25/analyze-your-iis-log-files-favorite-log-parser-queries.aspx

Author

Commented:
Thank you, that makes sense!
Just Worked for me, but the website above states:

PLEASE BE AWARE OF THE FOLLOWING:
WINDOWS SERVICING EVENTS (I.E. HOTFIXES AND SERVICE PACKS) WOULD STILL REPLACE FILES IN THE ORIGINAL DIRECTORIES. THE LIKELIHOOD THAT FILES IN THE INETPUB DIRECTORIES HAVE
TO BE REPLACED BY SERVICING IS LOW BUT FOR THIS REASON DELETING THE ORIGINAL DIRECTORIES IS NOT POSSIBLE.

So I just deleted the 14,2GB of log files that were filling up my C drive and left al the other folder just in case.

On my D drive I left all the log files.