Re: Database logging with IIS 7.0

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi TJ,

Sorry for the long delay. I spent quite a bit of time investigating this
one. I'm happy to report I was able to get ODBC logging to work but made the
cardinal sin of working late in the night and making several changes without
writing them down before a reboot. I am still troubled by the fact that the
same error continues to be generated in the system log when I restart IIS
however the entries are coming in to the table.

For this test I installed a fresh Windows 2008 R2 and SQL 2008 SP1 on the
same server. It did not take me to long to reproduce the system log error.
The error was generated immediately after I had ran the appcmd command to set
the website to use ODBC logging and recycled IIS.

In addition to going through Steve's blog on this topic (Thanks Steve!)
there were a few things I checked:

* run cliconfg.exe and enable TCP/IP and Named Pipes if not already. Out of
the box with a fresh install mine were disabled.

* When you configure the System DSN in the ODBC connection, verify your
Named Pipes settings are valid. For my test lab scenerio with SQL installed
on the same box as IIS the named pipe should be

\\.\pipe\sql\query

I noticed this was somehow blown away and I had to put this entry back in
there.

Here is an article on creating a valid connection string using named pipes
that I think you will find useful:

http://msdn.microsoft.com/en-us/library/ms189307.aspx

The last few things I did were to install IIS Advanced Logging (see below
for link) and use it to set the standard IIS log file. After setting logging
to use standard IIS logging format I recylced IIS then reran the command:

appcmd set site "The Name of Your Website Here" -logFile.logFormat:Custom
-logFile.customLogPluginClsid:{FF16065B-DE82-11CF-BC0A-00AA006111E0}

I browsed the website and looked in the table to find entries.

My guess is enabling Named Pipes using cliconfg and getting a valid named
pipes connection was the semi-solution to getting it to work for me. I say
semi because that error shouldn't be writing to the system log. I will
continue to work on this as time permits.

I hope these suggestions help get you to semi-solution. :)

IIS Advanced Logging:
http://www.microsoft.com/downloads/details.aspx?familyid=793051A8-36A0-4342-BDFE-47A6B0E3488F


All the best,
Jeffrey Ingalls


"Thomas J" wrote:

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
.

.



Relevant Pages

  • Re: Database logging with IIS 7.0
    ... Here is an article with some additional steps I did to get to ODBC Logging ... Microsoft MVP - IIS ... Logging to a remote SQL Server and logging to a local SQL Express ...
    (microsoft.public.inetserver.iis)
  • RE: SBS 2003
    ... The following article describes how to configure IIS logging to an ODBC ... | Elmo Scheffer ...
    (microsoft.public.windows.server.setup)
  • ODBC logging error
    ... I have a web site set up with IIS 6.0 logging via ODBC to SQL Server. ...
    (microsoft.public.sqlserver.odbc)
  • Re: ODBC logging inserts forward slash in front of target column dat
    ... I don't have ODBC logging to test now. ... but if IIS 6 logging detail changed ... I guessed you need to change your app to fit it. ... Windows 2000 Servers, but it fails on Windows 2003 Server (SP1, standard, ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: owa goes to wrong page.
    ... They haven't been using host header name on the system. ... I rechecked the log visits etc. Do you know if i upgrade to iis 5.1 will it show up under the version info through mmc. ... I found through checking w3svc log it stopped logging and i can not get it to start to trouble shoot. ...
    (microsoft.public.exchange.admin)