Dynamically finding the logfile folder

S

Scott McNair

Hi,

I'm writing an ASP page that will analyze the logfiles and return
statistical information. I'd like to make this app so that I could drop it
into any of my webservers and get the logs for that server. Is there a way
to determine dynamically the location of the logfiles?

Regards,
Scott
 
M

Manohar Kamath [MVP]

Must have clicked send button little too soon..

The log file location is in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W3SVC\Parameters\LogFil
eDirectory

Since you can not access the registry with simple ASP page, you might have
to write a component that will do that for you. Or even have a Windows
Script that can do that, but then your ASP page has to run with enough
permissions to access the registry (such as the admin permissions).
 
S

Scott McNair

The log file location is in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W3SVC\Parameters
\LogFil eDirectory

Thank you, Manohar, for your quick response.

How would I find out the particular instance name? For example if I'm
running on W2K Server, and I've got W3SVC1, W3SVC2, and W3SVC3, and the
app is being run by W3SVC2, how would I find that out? I've found a
couple of server variables (APPL_MD_PATH and INSTANCE_META_PATH) that
contain it after a fashion (e.g. "/LM/W3SVC/1/ROOT") so I suppose if I
needed to, I could strip the instance name out of one of those, but is
that info stored in an easier to access location?

Thanks again for your help.

Regards,
Scott
 
S

Scott McNair

Request.ServerVariables("INSTANCE_ID")

Thanks, Mark.

Would all instances be name "W3SVC" & R.SV("INSTANCE_ID")? Or would there
be a situation where the instance would be named something other than
"W3SVC"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,430
Latest member
7dog123

Latest Threads

Top