Friday, March 9, 2012

Programmatically determine IIS log directory

I wrote a custom IIS log reader windows service that reads and parses log data and periodically uploads it to a SQL server table which I run my reports from later. Currently I read the file by giving the absolute physical path name for the log directory followed by the log file name I anticipate depending on date/time stamps.

My question is: Is there a programmatic way to get the directory path which is configured in IIS to store the IIS log files to? We use non default location e.g. D:\DATA\LOGS\IIS\W3SVC1 or something similar, which might change from server to server. Also, I am not worried about the individual log file names but the directory. I would prefer a C# code example.

Any help is appreciated!

KC

Hi,

I'm sorry that I don't have a solution to your problem, but your reader sounds like something I really could use. Any chance I could get you to send me a copy of the program? Unfortunately I'm a delphi programmer so I can't help you out, but I'm learning C in my spare (ha!) time and your code and logic could help me come up with a solution for my company. My email address is:

lkuderick

@.

hotmail

.

com

if you can help.

Thanks!

>> larry <<

No comments:

Post a Comment