# Retrieve the error logs

> Find the path of the SQL Server ERRORLOG files with SERVERPROPERTY, identify the rotated logs, and zip them to send them for analysis.
>
> Source : https://www.pachadata.com/en/docs/howtos/troubleshooting/retrieve-error-log/
> Author : Rudi Bruchez · updated 2026-10-14
> Markdown version of the page, for tools and LLMs. The HTML page is the reference.


To analyze problems on a SQL Server instance, retrieve the SQL Server error logs (`ERRORLOG`). They hold a great deal of useful information.

## Retrieve the logs

The error logs are text files, in a specific directory under the SQL Server data folder.

You can find its path with this query:

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

There you will find `ERRORLOG`, the current log, and the `ERRORLOG.*` files, where `*` is a number. After a rotation — usually at instance restart — the previous log becomes number 1, the one before it number 2, and so on.

**Zip them**: these files compress extremely well.

Then send me the archive.


---

## About the author

Rudi Bruchez, independent SQL Server consultant since 2006: performance audits, tuning, migrations, high availability and training. For an audit or hands-on help on your server: https://www.pachadata.com/en/contact/ (remote audit: https://www.pachadata.com/en/services/remote-sql-server-audit/).
