If you can connect to the SQL Server instance, run this read-only query to find its Database Engine error-log path:
SELECT SERVERPROPERTY('ErrorLogFileName') AS ErrorLogFileName;On Windows, if the instance will not start, open SQL Server Configuration Manager, select the instance's properties, and read the path after -e on the Startup Parameters tab. You do not need to change a setting or restart the service to find the path.
This is the Database Engine ERRORLOG, not the database's .ldf transaction log or SQL Server Agent's log. A custom installation can use a different path, so use the instance's actual setting rather than assuming the default folder.
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' = descendingThe 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 it's “SQL2017”)
- Right-click, go to Properties
- Look for the Startup Parameters tab
One of the “Existing parameters” shows the error log path.

Here is the location of SQL Server logs on my laptop:
On Linux, the default error-log file is /var/opt/mssql/log/errorlog. On Windows, the active file is normally named ERRORLOG; numbered files such as ERRORLOG.1 are archived logs. Custom paths can differ.

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:

The steps above only locate the log. The optional instructions below change where logs are written. Plan a maintenance window before restarting SQL Server, and first verify that the destination folder exists and that the SQL Server service account can write to it. A bad path or missing permission can prevent the instance from starting.
To change or move the error log path, I do this using SQL Server Configuration Manager. Change parameter -e.
Restart the SQL Service.
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';
GOWhen reviewing the SQL Server, checking the error log is one of the first things I do.
It often has a lot of good info!

