How to configure IIS to post logs to sql server

.net-4.0analyticsiis-7.5loggingsql-server-2008

how do I configure IIS to post logs to sql server?

How want to save ANY log to my site. the site has a lot of views and the data can be big in a very small time. In addition, I want to show analytics of the use, in real time, and for all the time.

  • Is it make sense to save all the logs in sql-server?

  • What is the pros and cons taking this approach have?

  • what other solution can I have?

Best Answer

Microsoft has courteously created an entire KB article called "How To Use SQL Server to Analyze Web Logs" which should answer your title question.

Yes it makes sense to store the logs in sql server if for no other reason than mitigating file corruption issues and also making backups of those files easier using SQL scheduler. The pros of using a SQL Server database are virtually self evident. Flat text files offer no data mining ability. Relational databases that can be queried via SQL are made for information storage and retrieval. That information can easily be culled for trends, statistics, correlations and etc. It's all a matter of developing the queries and reports.

What other solution? Possible using Splunk to gather information from the flat files, but that's not the same. That's not statistics in quite the same way.

Related Topic