Server 2008 R2/ logging not working

189 views
Skip to first unread message

philw

unread,
Nov 15, 2010, 12:25:14 PM11/15/10
to ELMAH
I have 2 installs on Windows 7 and one on Windows Server (pre-R2).
These all use ELMAH under IIS7 in integrated mode and they work
brilliantly: users break something, and we fix it before they report
it to us. Thanks guys.

The Problem: No logging
------------------------------------
I now have 2 new installs, both on Windows Server 2008 R2, and
although the EMLAH configuration is identical (it's created by
script), it's not working. The IIS installs work, but when I test the
"yellow screen of death" stuff I get my yellow screen ok, but the
ELMAH error log (/secure/elmah.axd) is visible but empty; no emails
are sent, and there's nothing where I expect to see it in /App_Data.

Permissions?
-------------------
So I googled and checked the obvious things... mostly I suspected
permissions, so I gave IIS_IUSRS full control of App_Data, but that
didn't fix it. In desperation I added NETWORK_SERVICE but I knew that
was pointless so once it made no difference I took it away again.

I heard somewhere that removing:
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data"/>
would make the logging happen in memory, so removing permissions from
the list of possible issues. I removed that line, and it made no
difference, so I put it back.

What Next?
------------------
Hence I don't think this is a file permissions issue.

Does any one have any suggestions as to what I could try?

There is presumably something different in the machine.config of a
standard IIS7 install on R2 which I'm not dealing with. This is all
ASP.NET2.0/3.5 SP1 (not 4), although that should make no odds. It's
failing to work sufficiently quietly that I can't tell what it is...

philw

unread,
Nov 15, 2010, 1:01:54 PM11/15/10
to ELMAH
I thought it may be differences in machine.config/ web/config in the
server between R2 and the earlier version, but comparing those files,
there are a lot of changes, but nothing which looks likely to cause
ELMAH to stop working.

I checked "feature delegation", and delegated everything explicitly to
my site, but that made no difference either.

James_2JS

unread,
Nov 15, 2010, 1:06:14 PM11/15/10
to ELMAH
Hi there,

A few things...

1) Could you post the relevant sections of your web.config file so we
can see what's going on??

2) Visit /secure/elmah.axd and see what ELMAH thinks the configuration
is... look at the bottom section... it will say something like Powered
by ELMAH, version XXXXXXX [.....] The log is provided by the XXX Error
Log.
Hopefully it will be version 1.1 and the Xml Error Log!!

3) Now try the following:
a) Remove the <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/
App_Data"/> line as you have previously tried... then
b) Visit /secure/elmah.axd/test This should generate a test exception
c) Visit /secure/elmah.axd and see if it is logged... and also check
that it is now using the Memory Error Log

Cheers,

James

philw

unread,
Nov 15, 2010, 2:09:29 PM11/15/10
to ELMAH
Thanks..
(1) I didn't before as these work fine in R1, but here they are...

<configuration>
<configSections>
...
<sectionGroup name="elmah">
<section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah"/>
<section name="errorLog" requirePermission="false"
type="Elmah.ErrorLogSectionHandler, Elmah"/>
<section name="errorMail" requirePermission="false"
type="Elmah.ErrorMailSectionHandler, Elmah"/>
<section name="errorFilter" requirePermission="false"
type="Elmah.ErrorFilterSectionHandler, Elmah"/>
</sectionGroup>
</configSections>
<elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/
App_Data"/>
<security allowRemoteAccess="yes"/>
<errorMail from="*.*stratify@*.*.uk" to="*@*.co.uk"
subject="ELMAH error report"/>
<!-- Errors are filtered (don't appear in log or email) when
any of the following conditions occur:
- the address is localhost (IPv4 or IPv6) -->
<errorFilter>
...
</errorFilter>
</elmah>
...
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
...
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"
preCondition="managedHandler"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule,
Elmah" preCondition="managedHandler"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/
>
</modules>
<handlers>
...
<add name="Elmah" path="/secure/elmah.axd"
verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah"
preCondition="integratedMode"/>
</handlers>

> 2) Visit /secure/elmah.axd and see what ELMAH thinks the configuration is...
Powered by ELMAH, version 1.1.11517.2009. Copyright (c) 2004-9, Atif
Aziz. All rights reserved. Licensed under Apache License, Version 2.0.
Server date is Monday, 15 November 2010. Server time is 19:06:15. All
dates and times displayed are in the GMT Standard Time zone. This log
is provided by the XML File-Based Error Log.

> Hopefully it will be version 1.1 and the Xml Error Log!!
Yup, that's what I've been using for the last year or so on the other
machines...


> 3) Now try the following:
> a) Remove the <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/
> App_Data"/> line as you have previously tried... then
> b) Visit /secure/elmah.axd/test This should generate a test exception
> c) Visit /secure/elmah.axd and see if it is logged... and also check
> that it is now using the Memory Error Log

I'd already done (a) and (b), and I repeated them with no results,
however I do see the "in memory log" prompt now, so it's reading the
change ok.


So the logging/ permissions aren't the issue.... it's not getting the
errors, it seems.

philw

unread,
Nov 16, 2010, 3:39:17 AM11/16/10
to ELMAH
Got it.... it's the JScript error filter (omitted from the above as I
did not think it important). If I strip the filter out, it works just
fine.

Which is weird, as those filters work perfectly on other pre-R2
systems. I will try to work out precisely which line of the filters is
causing the problem.

In summary: errorFilter works differently on R2, as far as I can tell.

James_2JS

unread,
Nov 16, 2010, 4:42:30 AM11/16/10
to ELMAH
Cool... we're getting somewhere!
How about you post your errorFilter section??
Reply all
Reply to author
Forward
0 new messages