By default, Microsoft IIS (Web server) logs every request to the server in a logfile. This may over time create unnecessarily large logfiles. These logfiles defaults to the system drive (c:), which in turn can bring the system to halt if it runs out of freespace. This logging functionality can easily be disabled by following this procedure.
To disable IIS (Internet Information Services) logging, you can do it either via the IIS Manager GUI or using PowerShell. Here's how to do both:
Option 1: Disable IIS Logging via IIS Manager
- Open IIS Manager (
inetmgr). - In the Connections pane, expand your server and select the site you want to configure.
- In the Features View, double-click Logging.
- In the Actions pane (right side), click Disable.
- Click Apply in the Actions pane to save the changes.
Option 2: Disable IIS Logging via PowerShell
You can use PowerShell to disable logging for a specific site:
Import-Module WebAdministrationSet-ItemProperty "IIS:\Sites\YourSiteName" -Name logFile.period -Value "DoNotCreateLogFiles"
Replace "YourSiteName" with the actual name of your IIS site.
Note
- Disabling logging can make troubleshooting more difficult, so it's generally recommended only for development environments or specific performance scenarios.
- If you're using centralized logging or a third-party tool, make sure disabling IIS logging doesn't interfere with your monitoring setup.
Comments
0 comments
Please sign in to leave a comment.