Each SQL Server Instance in a machine maintains its own error log. This error log file contains errors and informational events .

We can find error log location using the following ways.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

If SQL Server is in running state , we can find the error log location for that particular SQL Server Instance by executing the below query.

In SSMS paste this command:

USE MASTER

Download Banner

GO

EXEC  xp_readerrorlog 0, 1, N’Logging SQL Server messages in file’, NULL, NULL, N’asc’

GO

The parameters we can use with XP_READERRRORLOG are

Value of error log file you want to read: 0 = current, 1 = Archive #1 etc…

Log file type: 1 or NULL = error log, 2 = SQL Agent log

Search string 1: String one you want to search for

Search string 2: String two you want to search for to further refine the results

Search from start time

Search to end time

Sort order for results: N’asc’ = ascending,  N’desc’ = descending.

Using SQL Server Configuration Manager

Open the Configuration Manager of the SQL Server Instance to which you want to find the error log location.

In SQL Server Configuration Manager go to SQL Server Services.

Using SQL Server Configuration Manager

and then right click on the SQL Server instance to which you want to find the error log location. Go to properties, select Startup Parameters. In that, there will be existing Parameter start with -e that will point the error log location.

SQL Server instance

From Registry

In Registry “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\”

After reaching the above key path ,select Name of the SQL Server Instance name and then MSSQLSERVER\Parameters

Name of the SQL Server Instance

for example,

\MSSQL12.SQLSERVER2014\MSSQLServer\Parameters

In SQLArg1 you can find the error log path in the system.

Got questions? Email us at: vembu-support@vembu.com for answers.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Rate this post