change iis7 logs to a different hard drive [Answered]RSS

2 replies

Last post Oct 15, 2010 09:59 AM by lextm

  • change iis7 logs to a different hard drive

    Oct 15, 2010 02:55 AM|cheinan|LINK

    how do i change iis7 logs folder and files to a different hard drive after it is all ready installed on my window 2008 server ?

    did not find any information about this on the internet...

    thanks

    cheinan

    iis7 logs

  • Re: change iis7 logs to a different hard drive

    Oct 15, 2010 09:46 AM|Hades666|LINK

    Hi, 

    There are scripts out there that can move the defaults on a clean IIS install, but since you have sites already loaded, i think IIS Manager would be best.

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

    First, change Default LogPath going forward for IIS in general.
    %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"D:\IISLogs"
    %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"D:\IISLogs"
    %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"D:\IISLogs"

    Second, for your old sites, you can use appcmd to repoint the path or use IIS Manager. I find IIS Manager easier as it is just a cut-n-paste. However, If you want to use Appcmd, you can do it like such.

    LIST ALL SITE NAMES to get the site names
    %windir%\system32\inetsrv\appcmd list sites

    Move the Logs to new location

    Change LogPath for Default Web Site from default to D:\IISLogs
    %windir%\system32\inetsrv\appcmd set config -section:sites -[name='Default Web Site'].logfile.directory:d:\IISLogs

    Cheers,
    Hades666
  • Re: change iis7 logs to a different hard drive

    Oct 15, 2010 09:59 AM|lextm|LINK

    It can be changed at site level in IIS 7 Manager, and I wonder why you cannot take some time to check the Help file available in IIS 7 Manager. Sometimes the Internet only provides you garbage if you don't know how to search.
    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.