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?
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.
Do not do it - it introduces another hugh system into something as simple as writing log files. Resetting the SQL Server interrupts the logging process.
What I Do is:
Also see MS LogParser for loading IIS log FILES into SQL Server. e.g. http://www.jaygeiger.com/index.php/2010/11/09/load-iis-log-files-into-sql/