# WHERE ARE SQL SERVER ERROR LOGS STORED?

> URL: https://crodrigues.com/where-are-sql-server-error-logs-stored/  
> Author: Carlos Rodrigues  
> Published: 2015-08-13  
> Updated: 2026-10-21  
> Categories: Databases  
> Tags: databases, errorlog  

_Lately I had to provide the location of our SQL server error logs to an infra team, so they could be copied somewhere else. Raising a…
Continue readingWHERE ARE SQL SERVER ERROR LOGS STORED?_
Lately I had to provide the location of our SQL server error logs to an infra team, so they could be copied somewhere else.

Raising a ticket and asking the DBAs is always an option, but as usual will introduce some latency.

No worries, there’s a command we can run  to get hold of the error logs location:

```sql
exec sp_readerrorlog
```

This will return a set of text rows, one of which says something like:

**2015-10-07 01:52:07.770 Server       Logging SQL Server messages in file ‘ERROR LOG PATH**‘.

The problem is that I didn’t have any other rights on this SQL server, other than select permission, so it was impossible to execute this procedure.

Fear not, dear friends, there’s another way, using a simple select:

```sql
SELECT SERVERPROPERTY('ErrorLogFileName');
```

and this will return the exact error log path!

Cheers!
