How to Change the Log File Directory in IIS7 (2024)

How to Change the Log File Directory in IIS7

Exchange Server

How to Change the Log File Directory in IIS7 (1)

Post author:Written By Paul CunninghamPost published:August 3, 201113 Comments

On an Exchange Server 2010 Client Access server a lot of logging can be generated by IIS for client traffic such as OWA and ActiveSync.

For some servers the need to retain this logging for a long time may cause a disk space issue. To resolve this you can simply change the log file directory that IIS7 uses.

Open IIS Manager from Administrative Tools and click on the Default Web Site.

How to Change the Log File Directory in IIS7 (2)

Double-click the Logging icon.

How to Change the Log File Directory in IIS7 (3)

Type in the path to the new log directory that you want to use, or click Browse and navigate to it.

How to Change the Log File Directory in IIS7 (4)When you’ve entered or chosen the new log directory click Apply.

How to Change the Log File Directory in IIS7 (5)

The new directory will be created (if it doesn’t already exist) when the next log entries are written by the server.

You can copy the existing logs from the old location to the new log directory. Just be aware that the server may have already created a log file in the new directory for the current day, but you can simply tell the copy to keep both files by renaming one of them. Or if you make the change during a period of the day that there is no activity then you probably won’t run into any duplicate file name issues.

We can also make the same configuration change using Powershell. From a Powershell window type the following commands.

PS C:\> Import-Module WebAdministrationPS C:\> Set-ItemProperty 'IIS:SitesDefault Web Site' -name logfile.directory "D:IISLogs"

Tags: Exchange 2010, IIS, PowerShell, Windows 2008

About the Author

Paul Cunningham

About the Author

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. How to Change the Log File Directory in IIS7 (7)

    Val Suarez 8 Jun 2017Reply

    Actually, you only have to restart the website in order for the new log file location to take affect. Add a line to your script to bounce the site and voila!!! I recommend creating a folder structure as follows: d:\IIS LOG FILES\WEBSITE NAME. A folder will get created inside of the WEBSITE NAME folder but at least you know which site you are looking at.

  2. How to Change the Log File Directory in IIS7 (8)

    Bryan McGill 20 Oct 2016Reply

    For me in IIS 8.5 the httperr logs location persisted to the old location after I made a location change in IIS at the server level. The sites were logging to the new location, but not the httperr log. WinServer 2012 R2.
    I restarted IIS at least twice. I verified the sites retained the new logs location and the server level as well.
    I checked hklm:SystemCurrentControlSetserviceshttpparameters
    ErrorLoggingDir was still set to the old location. I rebooted the server. Same results.

    I looked everywhere to try and find a setting to update this registry value and did not find anything.
    I saved a backup of my registry and then updated the setting manually.
    I reset IIS. Still did not update.
    I rebooted the server. Finally. The httperr log was created and logging to my new location.

  3. How to Change the Log File Directory in IIS7 (9)

    zohaib 20 Jun 2016Reply

    How can i got session id in IIS log file . is there any custom field adding that guage the sessions or any other way to find out the no of session

    Many thanks

  4. Pingback: PowerShell Script: IIS Log Files Cleanup

  5. How to Change the Log File Directory in IIS7 (10)

    Kirt 26 Mar 2014Reply

    IIS restart was required. Did it twice to verify IIS restart is required. Each time I changed the log location and tested I got 500 error until I restarted IIS.

  6. How to Change the Log File Directory in IIS7 (11)

    dominique 7 Jun 2013Reply

    Same question here!!!
    Does IIS have to be restarted for this to take effect? I do not see a change using the powershell commands.

    1. How to Change the Log File Directory in IIS7 (12)

      Paul Cunningham The Real Person! Author Paul Cunningham acts as a real person and verified as not a bot. Passed all tests against spam bots. Anti-Spam by CleanTalk. The Real Person! Author Paul Cunningham acts as a real person and verified as not a bot. Passed all tests against spam bots. Anti-Spam by CleanTalk. 7 Jun 2013Reply

      “The new directory will be created (if it doesn’t already exist) when the next log entries are written by the server.”

      I’ve just retested to confirm that. At least on my own server it is working that way.

  7. How to Change the Log File Directory in IIS7 (18)

    internetrush 5 Jun 2013Reply

    Also, how do you change the Master (servername) default logging location for IIS?

    1. How to Change the Log File Directory in IIS7 (19)

      Barbi 15 Aug 2014Reply

      That’s not just the best anwers. It’s the bestest answer!

  8. How to Change the Log File Directory in IIS7 (20)

    internetrush 5 Jun 2013Reply

    Does IIS have to be restarted for this to take effect? I do not see a change using the powershell commands.

    1. How to Change the Log File Directory in IIS7 (21)

      Ricardo Fuentes 22 Jan 2014Reply

      No, it doesn’t require a IIS reset.

  9. How to Change the Log File Directory in IIS7 (22)

    Surfer Joe 6 Jul 2012Reply

    Dude, how can I get rename W3SVC6, etc. to the name of the site in IIS?

Leave a Reply

How to Change the Log File Directory in IIS7 (2024)
Top Articles
How to Buy a Specific Phone Number?
Chapter 1: How Rollovers as Business Startups (ROBS) Works - Guidant
Sprinter Tyrone's Unblocked Games
Best Big Jumpshot 2K23
Craigslist Motorcycles Jacksonville Florida
Watch Mashle 2nd Season Anime Free on Gogoanime
Wild Smile Stapleton
Ogeechee Tech Blackboard
Over70Dating Login
Boat Jumping Female Otezla Commercial Actress
Aita Autism
Nexus Crossword Puzzle Solver
Explore Top Free Tattoo Fonts: Style Your Ink Perfectly! 🖌️
TS-Optics ToupTek Color Astro Camera 2600CP Sony IMX571 Sensor D=28.3 mm-TS2600CP
Dexter Gomovies
Ostateillustrated Com Message Boards
Dtab Customs
Inter-Tech IM-2 Expander/SAMA IM01 Pro
Craigslist Org Appleton Wi
How to Grow and Care for Four O'Clock Plants
Rochester Ny Missed Connections
Walgreens Bunce Rd
Gs Dental Associates
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Ullu Coupon Code
Pokémon Unbound Starters
HP PARTSURFER - spare part search portal
Maths Open Ref
Free Tiktok Likes Compara Smm
Leland Nc Craigslist
Whas Golf Card
Daily Jail Count - Harrison County Sheriff's Office - Mississippi
Henry County Illuminate
Streameast.xy2
Housing Intranet Unt
888-333-4026
Barstool Sports Gif
Engr 2300 Osu
Mychart University Of Iowa Hospital
My Gsu Portal
Spreading Unverified Info Crossword Clue
Jimmy John's Near Me Open
25 Hotels TRULY CLOSEST to Woollett Aquatics Center, Irvine, CA
Stoughton Commuter Rail Schedule
Guy Ritchie's The Covenant Showtimes Near Look Cinemas Redlands
Definition of WMT
Lux Funeral New Braunfels
Ciara Rose Scalia-Hirschman
Coleman Funeral Home Olive Branch Ms Obituaries
Craigslist Psl
Joe Bartosik Ms
Qvc Com Blogs
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 6431

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.