Hi,
I am trying to write a powershell function which is conceptually quite simple but I am having a hard time getting the right information. Maybe the experts can help.
What I want, essentially, is the current path of the logfile for a particular site. e.g. if my site is named "devang", I want to write a function called "show-log devang" which should "tail" the logfile for the site "devang" (assume that I have the logging configured to have a separate file at the site level).
Why is this hard? Well, it looks like in IIS, a directory like "w3csvc1" is created in the standard logs directory. The mapping from "devang" to "w3svc1" is known to IIS but is not obvious otherwise. In addition, IIS rotates the log (daily, weekly, etc.) and so the current file name is not stable.
IIS has to know what file it is writing the log to...so, how do I query IIS to get the full path name?
Hope someone can help?
Thanks.