Skip to contentGo to the directory tree
FolderRisk: Caution

W3SVC1 C:\inetpub\logs\LogFiles\W3SVC1

W3SVC1: IIS logs for the site with ID 1 (the Default Web Site); the number is the site ID, and there is one W3SVC<id> folder per site.

Updated on By AltF4 Formation

What it’s for

IIS creates one W3SVC<id> folder per site to write its request logs. The number is the site’s ID in applicationHost.config, not a counter: W3SVC1 belongs to the first site, normally the Default Web Site, and a site created later gets W3SVC2, W3SVC3, according to its id. FTP sites use FTPSVC<id>.

What it contains

The site’s u_ex<yymmdd>.log files, one per day by default. IIS never purges them: the folder keeps growing until you set up a cleanup. The location is changed site by site in IIS Manager (Logging, Directory).

Requests rejected before reaching a site (HTTP.sys errors) go elsewhere, to C:\Windows\System32\LogFiles\HTTPERR.

Risks and best practices

  • Schedule deletion or archiving of old logs with a scheduled task: on a busy site this folder fills the system volume.
  • Put production logs on a volume separate from C: so a heavily used site cannot saturate it.
  • To find which site a folder belongs to, check its id with Get-Website.
  • These logs contain client IP addresses: treat them as personal data.

Useful commands

Fenêtre de terminal
# Site ID, name and log folder
Import-Module WebAdministration
Get-Website | Select-Object Name, Id, @{n='Logs';e={$_.logFile.directory + '\W3SVC' + $_.Id}}
# Most recent log files
Get-ChildItem C:\inetpub\logs\LogFiles\W3SVC1 | Sort-Object LastWriteTime -Descending | Select-Object -First 5 Name, Length, LastWriteTime
# Space used (MB)
(Get-ChildItem C:\inetpub\logs\LogFiles\W3SVC1 -File | Measure-Object Length -Sum).Sum / 1MB

Folder contents

Report a mistake