4 step by step methods to find SQL Server error log location
You can check the SQL Server error log path in a few ways:
1. Using T-SQL
Find the SQL Server error log location setting:
USE master
GO
EXEC sys.xp_readerrorlog 0
,--Value of error log file you want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc...
1
,--Log file type: 1 or NULL = error log, 2 = SQL Agent log
N'Logging SQL Server messages in file'
,--Search string 1: String you want to find
NULL
,--Search string 2: String two you want to search for to further refine the results
NULL
,--Search from start time
NULL
,--Search to end time
N'asc' --Sort order for results: N'asc' = ascending, N'desc' = descending
The result should be:

2. SQL Configuration Manager
Accessing SQL Server Configuration Manager:
- Go to SQL Server Services
- Click on the SQL instance on the right (In my case its “SQL2017”)
- Right-click, go to Properties
- Look for the Startup Parameters tab
One of the “Existing parameters” shows the error log path.

Here are SQL Server logs location on my laptop:

3. Using Event Viewer
Start the Event Viewer (you can use the search box near the Start button).
- Click on the Windows Logs > Application > Filter Current Log
- Replace <All Event IDs> with EventID 17111 and hit OK.



4. Using registry
Are you serious? Are you going to try to look up the path using the registry?
Yeah, it is possible.
You have three methods above to do this. I do not see a good reason to go the registry route, but in case you must, here it is:

To change or move the error log path, I do this using SQL Server Configuration Manager, change parameter -e
.
Restart the SQL Service.
Warning: if the directory does not exist or SQL Server Service does not have enough permissions, SQL Engine will not start.
You will most likely get the “The request failed or the service did not respond in a timely fashion…” error.
To check the SQL Server Agent error log location, go to SQL Server Management Studio > SQL Server Agent > right-click on Properties.

To change the SQL Server Agent error log, just run this:
USE msdb GO
EXEC msdb.dbo.sp_set_sqlagent_properties @errorlog_file = N'<New_Errorlog_Path>\SQLAGENT.OUT' GO
When reviewing the SQL Server, checking the error log is one of the first things I do.
It often has a lot of good info!