we got some connections timeouts running a stored procedure in a SQL Server 2008 instance. after a while, the DB started to work as usual, and there weren't any additional timeout errors.
So I'm trying to get additional info about the error.
Does SQL server 2008 have any kind of error log that I can look into?
Do exist any auditing/logging features that I can activate to trace the error (if it happens again)?
To see the SQL Logs: Connect to your SQL instance via Management Studio, expand the Management folder in the object browser, expand the SQL Server logs folder and you can examine your logs.
Default behavior is to keep six logs with a new one being created each time the database engine server is restarted.
Profiler can always be used to see what is happening under the covers.
You might post the messages associated with your timeout...
SQL Server logs won't capture application timeouts, as they are generated by the client code, not the SQL Server.
To capture long running queries, you need to use SQL Profiler. Setup a trace which captures all commands which take over 30 seconds (the default .NET timeout) and see what comes up.
That or put code in the application so that when it gets a timeout it logs some data about the query that it was running, and the failure reason.
The currently selected answer is slightly misleading as it discusses referencing the SQL Server Error Log, which will not help for the given scenario.
As mrdenny quite rightly points out.....
Application timeouts to SQL Server are initiated from the client-side as Attention Events and are not recorded in the SQL Server Error Log.
You can monitor for Attention Events using: