Umbraco网站和IIS日志 [英] Umbraco websites and IIS Logging
问题描述
我在Azure云中有一个Umbraco实例,如果内存正常运行,则为v4.7。我需要利用IIS日志记录获取网站使用统计信息,但似乎有一个限制。
I have an Umbraco instance in the Azure cloud, v4.7 if memory serves correctly. I need to utilise IIS logging to obtain website usage statistics, but there appears to be a limitation.
我有多个不同的网站,所有网站都使用各种网站模板,但IIS日志不要显示输出域名。如何让IIS输出域名?
I have multiple different websites, all using various website templates but the IIS logs don't appear to output the domain name. How can I get IIS to output the domain name?
以下是当前IIS日志捕获的示例(我知道这是一个BOT抓取网页,但是我有真正的流量,但不能识别哪个网站被访问):
Below is an example of what the current IIS logs capture (I know this is a BOT crawling the webpages, but I have genuine traffic but can't identify which website is visited):
2012-08-06 00:11:54 10.61.52.73 GET / insurance / insurance / - 80 -
46.4.38.67 InnovantageBot / 1.0 +(http://www.innovantage.co.uk/technology/webmaster_information.htm)200 0 0 390 2012-08-06 00:11:55 10.61.52.73 GET /保险/理由/ - 80 - 46.4.38.67 InnovantageBot / 1.0 +(http://www.innovantage.co.uk/technology/webmaster_information.htm)200 0 0 578 2012-08-06 00:11:55 10.61.52.73 GET / insurance / type / - 80
00:11:55 10.61.52.73 GET / life / qa / - 80 - 46.4.38.67 InnovantageBot / 1.0 +(http://www.innovantage.co.uk/technology /webmaster_information.htm)200 0 0 359 2012-08-06 00:11:55 10.61.52.73 GET / life / reasons / - 80 -
46.4.38.67 InnovantageBot / 1.0 +(http://www.innovantage .co.uk / technology / webmaster_information.htm)200 0 0 328 2 012-08-06 00:11:57 10.61.52.73 GET / insurance / glossary / - 80 - 46.4.38.67 InnovantageBot / 1.0 +(http://www.innovantage.co.uk/technology/webmaster_information.htm)200 0 0 374
2012-08-06 00:11:54 10.61.52.73 GET /insurance/insurance/ - 80 - 46.4.38.67 InnovantageBot/1.0+(http://www.innovantage.co.uk/technology/webmaster_information.htm) 200 0 0 390 2012-08-06 00:11:55 10.61.52.73 GET /insurance/reason/ - 80 - 46.4.38.67 InnovantageBot/1.0+(http://www.innovantage.co.uk/technology/webmaster_information.htm) 200 0 0 578 2012-08-06 00:11:55 10.61.52.73 GET /insurance/type/ - 80 00:11:55 10.61.52.73 GET /life/qa/ - 80 - 46.4.38.67 InnovantageBot/1.0+(http://www.innovantage.co.uk/technology/webmaster_information.htm) 200 0 0 359 2012-08-06 00:11:55 10.61.52.73 GET /life/reasons/ - 80 - 46.4.38.67 InnovantageBot/1.0+(http://www.innovantage.co.uk/technology/webmaster_information.htm) 200 0 0 328 2012-08-06 00:11:57 10.61.52.73 GET /insurance/glossary/ - 80 - 46.4.38.67 InnovantageBot/1.0+(http://www.innovantage.co.uk/technology/webmaster_information.htm) 200 0 0 374
推荐答案
在您的WebRole.cs中,可以调整IIS和IIS中运行的每个站点。您可以选择哪些字段应该被记录,我想你正在寻找 LogExtFileFlags.Host
字段:
In your WebRole.cs you can tweak IIS and each site running in IIS. You can choose which fields should be logged and I think you're looking for the LogExtFileFlags.Host
field:
using (var manager = new ServerManager())
{
var siteName = RoleEnvironment.CurrentRoleInstance.Id + "_Web";
var site = manager.Sites[siteName];
site.LogFile.LogExtFileFlags |= LogExtFileFlags.Host;
manager.CommitChanges();
}
确保您的角色在升级模式下运行,在 ServiceDefinition.csdef 文件:
Make sure your role is running in elevated mode, change this in your ServiceDefinition.csdef file:
<Runtime executionContext="elevated" />
您还可以使用 appcmd.exe 更改此设置:
And you should also be able to change this setting using appcmd.exe:
http://www.iis.net/ConfigReference/system.applicationHost/sites/siteDefaults/logFile#005
这篇关于Umbraco网站和IIS日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!