Where is my SQL Error log?

Where is my SQL Error log?

  • Comments 2

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.

  • Thanks!

  • Another option would be executing XP_READERRORLOG. The result (5th row)  will contain the full path of the error log file.

Page 1 of 1 (2 items)
Leave a Comment
  • Please add 2 and 1 and type the answer here:
  • Post