Where is my SQL Error log?
Today I found a new (for me), undocumented method for identifying the location of the SQL Error log. I knew you could either check the registry or use SQL Server Configuration Manager and the "startup parameters" option. I ran SQL Profiler while opening up a SQL Error log in SQL Server Management Studio and found that SERVERPROPERTY has an option called 'ErrorLogFileName', as demonstrated here:
SELECT SERVERPROPERTY('ErrorLogFileName')
Again - you won't find it in Books Online, so it is officially undocumented with all the risks that implies - but useful for large environments where you're not always sure where the error logs reside and need to collect them directly for root cause analysis.
I am a dedicated support engineer in the Microsoft Premier Field Engineering organization and have worked with SQL Server since 1997. I'm responsible for proactive and reactive support of enterprise customer environments.
When time permits, I like to write and review technical books and articles. My third and latest book is "SQL Server 2008 Transact-SQL Recipes" (Apress, July 2008).