title: Programmatically retrieving IIS log file location in an ASP.NET application
body: <p>I'm trying to determine the location of the IIS log file location of my ASP.NET application. I tried WMI, but wasn't able to find it. Any suggestions?</p>
  
  <p>Note: I want to be able to retrieve the location programmatically; inside my application for further use.
  Edit: Here's my code: This works but does not give me the actual physical directory location of the logs. So this is basically useless.</p>
  
  <pre><code>ManagementPath p2=new ManagementPath("IIsLogModule.Name='logging/Microsoft IIS Log File Format'");
  ManagementObject log = new ManagementObject(scope, p2, objectGet);
  log.Get();
  logPath.Text = log["__PATH"].ToString();
  </code></pre>