From: Thomas J on
Hi Steve

What do you mean by "custom logging set on the site"? If I browse to
the site in IIS and double click "Logging" the Format is set to
'Custom' and on the Actions pane (on the right) the word 'Disable' is
available, thus indicating logging is currently enabled. Is this what
you mean? I can't find any other settings for custom logging.

I checked the Connection options and "Allow remote connections to this
server" is ticked. Named Pipes and TCP/IP are both set to enabled. I
have reboooted the server since changing these settings. This is the
same on the local and the remote SQL Server instances.

There are no firewalls on either the web or the database server. The
traffic between the two servers should be direct and shouldn't pass
through any firewalls.

Thank you very much for your help on this.

Kind regards,
TJ
From: Steve Schofield on
Hi Thomas,

Here is an article with some additional steps I did to get to ODBC Logging
on IIS 7.5.

http://weblogs.asp.net/steveschofield/archive/2009/11/26/odbc-logging-iis-7-5-sql-server-2008.aspx

Hope this helps,

Steve Schofield
Microsoft MVP - IIS
"Thomas J" <newsgroups101(a)gmail.com> wrote in message
news:085c446b-db0a-4981-aa06-1559ada73b17(a)b25g2000prb.googlegroups.com...
> Hi
>
> I am trying to setup database logging with IIS 7. I am following these
> instructions:
> http://weblogs.asp.net/steveschofield/archive/2007/12/20/iis7-post-57-how-to-setup-odbc-logging-in-iis-7-0.aspx
>
> This is not working and I am receiving the following error in the
> System event log:
> "The World Wide Web Publishing Service (WWW Service) did not configure
> logging for site 1. The data field contains the error number."
>
> This is the same problem that has been experienced here:
> http://forums.iis.net/t/1154908.aspx
>
> This is a x64 W2K8 environment. SQL Server is 2008
>
> I have tried the following:
> - Logging to a remote SQL Server and logging to a local SQL Express
> 2008 instance. Same problem.
> - Turning on ODBC tracing. No log file was created.
> - Turning on SQL Profiler. Nothing was captured.
> - Tried all the three SQL Server ODBC clients (SQL Server, Native
> Clients, Native Clients 10). No difference
> - SQL Server user is a Sys Admin
> - Tried using Named Pipes and tried TCP/IP. No difference. (BTW Named
> Pipes is enabled on the SQL Servers)
> - Cross referenced my configuration with this article:
> http://blogs.iis.net/rakkimk/archive/2008/04/16/how-to-configure-iis-7-0-for-odbc-logging.aspx
> and checked my appcmd parameters a hundred times. Still no difference.
> - UAC is turned off.
>
> I believe this is a problem in IIS. This Event Viewer error message
> always appears during the Start phase of an IISRESET, even before a
> web resource is even access.
>
> From the applicationHost.config here is the odbcLogging section
> <odbcLogging dataSource="InternetDB" tableName="inetlog"
> userName="IISLogsUser"
> password="[enc:AesProvider:J5roPFr1OyiT4EmFUm1AjeoY3KJF0uGyLaKp9DSBKZE=:enc]"
> /
>>
>
> and here is the Site section:
> <site name="Microsoft Dynamics CRM" id="1"
> serverAutoStart="true">
> <application path="/" applicationPool="CRMAppPool">
> <virtualDirectory path="/" physicalPath="C:\inetpub
> \wwwroot" />
> </application>
> <application path="/ISV/Praxa/Praxa.Web"
> applicationPool="CRMAppPool">
> <virtualDirectory path="/" physicalPath="C:\inetpub
> \wwwroot\ISV\Praxa\Praxa.Web" />
> </application>
> <application path="/Help"
> applicationPool="CRMAppPool">
> <virtualDirectory path="/" physicalPath="C:\inetpub
> \wwwroot\Help" />
> </application>
> <bindings>
> <binding protocol="http" bindingInformation=":
> 80:" />
> </bindings>
> <logFile customLogPluginClsid="{FF16065B-DE82-11CF-
> BC0A-00AA006111E0}" logFormat="Custom" enabled="true" />
> </site>
>
> I have spent a full day on this, and my client cannot justify anymore
> time. I really hope someone can point me in the right direction.
>
> Regards,
> TJ


From: Jeffrey Ingalls on
TJ,

I have been able to reproduce the exact error in my lab. I'll post again
when I have an update.

All the best,
Jeffrey Ingalls

"Thomas J" wrote:

> Hi Jeffrey
>
> I took a Process Monitor capture as I was running the 'appcmd set
> sites' command, which is also when the issue is thrown to the System
> event log.
>
> You can download the capture from the following location (available
> for 10 day):
> https://www.yousendit.com/transfer.php?action=batch_download&send_id=781802597&email=22d4bea53477bfc0e225ebc69ee2d307
>
> Another difference between my setup and the blog setup is I am logging
> on a site called "Microsoft Dynamics CRM" rather than "Default Web
> Site". The "Microsoft Dynamics CRM" site is the only site in IIS and
> is on port 80.
>
> The commands I used to configure IIS were:
> appcmd set sites "Microsoft Dynamics CRM" -logFile.logFormat:Custom -
> logFile.customLogPluginClsid:{FF16065B-DE82-11CF-BC0A-00AA006111E0}
> appcmd set config -section:ODBCLogging -datasource:InternetDB -
> tableName:inetlog -username:IISLogsUser -password:P(a)SSwoRD
>
> Thanks again
> TJ
> .
>
From: Thomas J on
Hi Jeffrey, this sounds promising. Looking forward to your response.

Hi Steve. Thanks for your follow up Blog post. I tried your
suggestions:
- I changed the App Pool owner to a domain user, added this domain to
the local IIS_IUSRS group, and to SQL Server as a DBO.
Unfortunately this made no difference. I check the SQL Server logs I
have never experiencing the 'Login Failed' issue which you
experienced. I don't understand why the App Pool must run as a domain
user; authentication to SQL Server should be handled by the ODBC
connection. I am relucent to change the App Pool owner in production
as it is currently running with Network Service, and changing this
will require system testing. I noticed one difference with your App
Pool setup; my site has the setting Managed Pipeline Mode set to
Classic, not Integrated. I believe the system I am running requires
the Classic mode. Could this be a problem?

I couple of other question Steve:
- What ODBC protocol did you use? SQL Server, Native Clients, Native
Clients 10? Should it matter?
- Is Named Pipes required? Or will TCP/IP also work?
- Is your SQL Server 2008 local or remote?

thank again.
TJ
From: Steve Schofield on
I also ran into an issue where entries weren't being entered while the page
loaded. After adding named pipes, stuff started to work. I removed named
pipes, restarted sql the same behavior. The other tidbit the ODBC entry I
had to explicitly test the user that was recorded in applicationHost.config.
You should be able to run as network service now I think about it, just
grant the 'machine account' proper sql permissions. The server I was
testing on was sql server 2008 r2, which uses ApplicationHostIdentity as
default. Personally, if I have to use network service, I'll use a custom
account. I understand this is a production app so making architecture
changes like that requires a lot of testing, which usually there isn't time.

I couple of other question Steve:
- What ODBC protocol did you use? SQL Server, Native Clients, Native
Clients 10? Should it matter?

SQL Server - I wouldn't use Native Lcient or Native Client 10 according to
this article, they recommend use ODBC, which I assume is the sql server only
one.
http://support.microsoft.com/kb/931202

- Is Named Pipes required? Or will TCP/IP also work?
My stuff didn't work unless Named Pipes was enabled.

- Is your SQL Server 2008 local or remote?
It's local to the box.

SS

"Thomas J" <newsgroups101(a)gmail.com> wrote in message
news:e756ce9c-0741-4e0e-b692-aed956696f49(a)f20g2000prn.googlegroups.com...
> Hi Jeffrey, this sounds promising. Looking forward to your response.
>
> Hi Steve. Thanks for your follow up Blog post. I tried your
> suggestions:
> - I changed the App Pool owner to a domain user, added this domain to
> the local IIS_IUSRS group, and to SQL Server as a DBO.
> Unfortunately this made no difference. I check the SQL Server logs I
> have never experiencing the 'Login Failed' issue which you
> experienced. I don't understand why the App Pool must run as a domain
> user; authentication to SQL Server should be handled by the ODBC
> connection. I am relucent to change the App Pool owner in production
> as it is currently running with Network Service, and changing this
> will require system testing. I noticed one difference with your App
> Pool setup; my site has the setting Managed Pipeline Mode set to
> Classic, not Integrated. I believe the system I am running requires
> the Classic mode. Could this be a problem?
>
> I couple of other question Steve:
> - What ODBC protocol did you use? SQL Server, Native Clients, Native
> Clients 10? Should it matter?
> - Is Named Pipes required? Or will TCP/IP also work?
> - Is your SQL Server 2008 local or remote?
>
> thank again.
> TJ