IIS 7 and Above
IIS Logfiles Location
Last post Aug 15, 2008 06:14 AM by steve schofield
Aug 13, 2008 08:05 PM|grnr_rchrd|LINK
I am trying to read the contents of IIS logfiles using C#, but I do not know how to find where they are. The physical location on my PC is C:\inetpub\logs\LogFiles\W3SVC1.
In my software I am using:
But it says the path does not exist. I am also not sure that the foreach will bring back each file within the directory anyway. I think it will bring back each child directory, which is not what I want.
Can anyone point me in the right direction please.
Aug 14, 2008 03:35 PMemail@example.com|LINK
I do not know how to find where they are. The physical location on my PC is C:\inetpub\logs\LogFiles\W3SVC1.
Look in that folder and see if they really are there. Check permissions on the file/folder.
Aug 14, 2008 09:06 PM|dac3636|LINK
If all your trying to do is get the logfile names under that directory, try this.
DirectoryInfo iisDir =
myfiles = iisDir.GetFiles();
Like the other reply said, make sure to check the security on the directory.
Aug 15, 2008 06:14 AM|steve schofield|LINK
You are using the IIS provider, do you have the legacy tools installed?
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget