How to find corresponding log files folder for a web site?
Asked Answered
T

5

165

There are multiple web sites and multiple folders under inetpub\logs\LogFiles (W3SVC1, W3SVC2, etc). How can I find what folder is used by a given web site?

Terminology answered 15/3, 2012 at 10:45 Comment(0)
T
216

Ok, I've found this property - it's called "site id" and resides in "Advanced Properties" of the website.

Terminology answered 19/3, 2012 at 7:17 Comment(4)
Obvious to some and not to others (myself), the Site Id can only be a number, not alphanumeric characters.Start
which is in IIS7: R-click on site, select 'Manage Web Site' --> 'Advanced Settings'Berliner
It's also shown on the root Sites node, in the listing.Celeriac
ID: the webste unique identify, use for log files and trace filesSpur
L
35

'Open IIS manager, click on the top level websites folder, view the lists of sites in the right hand pane, listing the App ID's.'

enter image description here

thanks to Sam on Server Fault

Longs answered 5/2, 2013 at 10:54 Comment(1)
This is also true on IIS 7.5.Arris
W
13

We can also get it using command line :

C:\>%windir%\system32\inetsrv\appcmd list site

The output would be like below:

SITE "Default Web Site" (id:1,bindings:HTTP/*:80:,state:Started)
SITE "Site1" (id:2,bindings:http/*:81:,state:Started)

The id field corresponds to the id found in log files. inetpub\logs\LogFiles (W3SVC1, W3SVC2

Wharton answered 6/4, 2015 at 21:38 Comment(0)
T
5

You can find from website properties of IIS manager. With IIS 6 the Web Site ID is a randomly generated number for each site that is created other than the Default Web Site which has an Web Site ID of 1.

For example:

  • W3SVC1
  • W3SVC719499532
  • W3SVC383732556

Knowing which web site these being to is a problem as it requires you to manually look at each web site. The following VB script will allow you to output the ID and name.

Save the script to a file with a .VBS file extension and then run using this command (for IIS 6).

cscript MyFile.VBS

Function ProcessWebSite(ServiceType, SiteNumber)
Set IISWebSite = getObject("IIS://localhost/" & ServiceType & "/" & SiteNumber)
Set IISWebSiteRoot = getObject("IIS://localhost/" & ServiceType & "/" & SiteNumber & "/root")
ProcessWebSite = IISWebSite.ServerComment
Set IISWebSiteRoot = nothing
Set IISWebSite = Nothing
end function

Function ShowSites(ServiceType, ClassName, Title)
Wscript.echo "Web Sites Description"
Wscript.echo "==============================================================="
Set IISOBJ = getObject("IIS://localhost/" & ServiceType)
for each Web in IISOBJ
if (Web.Class = ClassName) then
wscript.echo Ucase(ServiceType) & "/" & Web.Name & _
Space(17-(len(Ucase(ServiceType))+1+len(Web.Name))) & " " & _
ProcessWebSite(ServiceType, Web.name)
end if
next
Set IISOBj=Nothing
WScript.Echo ""
End function

Call ShowSites("w3svc", "IIsWebServer", "Web")
Transmigrant answered 15/3, 2012 at 10:59 Comment(2)
I don't have such a dialog. Only a log properties tab, without file name. (Windows Server 2008)Terminology
It says "invalid syntax" at line 12Terminology
C
0

There is also another way of doing it: All the IIS logs would write the PORT Id as part of the Logs. E.g. a sample IIS log may look like this: 2018-06-08 18:17:29 10.172.87.35 HEAD /hbeat/ - 26358 - 192.xxx.xxx.xxx - - 200 0 0 0

in the above example, 26358 is my port Id and you will know this corresponds to which one of your websites on the same server. SO just open the log file and look for the port number.

Coolth answered 11/6, 2018 at 15:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.