Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 3.2 KB

viewing-the-sql-server-error-log.md

File metadata and controls

49 lines (36 loc) · 3.2 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic ms.collection helpviewer_keywords monikerRange
Viewing the SQL Server Error Log
Get help detecting problems in SQL Server by viewing the current error log, or backups of previous logs, to check whether processes finished successfully.
rwestMSFT
randolphwest
randolphwest
02/13/2025
sql
tools-other
conceptual
data-tools
cycling SQL Server error log
viewing SQL Server error log
errors [SQL Server], logs
SQL Server error log
displaying SQL Server error log
logs [SQL Server], SQL Server error logs
>=sql-server-2016

View the SQL Server error log

[!INCLUDE SQL Server Windows Only]

View the [!INCLUDE ssNoVersion] error log to ensure that processes complete successfully (for example, backup and restore operations, batch commands, or other scripts and processes). This procedure can be helpful to detect any current or potential problem areas, including automatic recovery messages (particularly if an instance of [!INCLUDE ssNoVersion] stopped and restarted), kernel messages, or other server-level error messages.

How to view the error log

You can view the [!INCLUDE ssNoVersion] error log with [!INCLUDE ssManStudioFull] or any text editor. For more information about how to view the error log, see Open Log File Viewer.

  • On Windows, the default location for the error log is <drive>:\Program Files\Microsoft SQL Server\MSSQL.<n>\MSSQL\LOG\ERRORLOG.

  • On Linux, the default location for the error log is /var/opt/mssql/log.

Note

The files are called ERRORLOG.<n>, where <n> is an integer. The current error log has no extension.

A new error log is created each time an instance of [!INCLUDE ssNoVersion] is started, although the sp_cycle_errorlog system stored procedure can be used to cycle the error log files without having to restart the instance of [!INCLUDE ssNoVersion]. Typically, [!INCLUDE ssNoVersion] retains backups of the previous six logs, and gives the most recent log backup the extension .1, the second most recent the extension .2, and so on. The current error log has no extension.

You can also view the [!INCLUDE ssNoVersion] error log on instances of [!INCLUDE ssNoVersion] that are offline or can't start. For more information, see View Offline Log Files.

Related content