SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Reading the log on SQL for Linux

The SQL Server errorlog is a really helpful place to find all sorts of fun facts about your SQL Server instance. As last checked today (6/29/2017) the latest CTP build seems to have problems reading the log.

This can be a problem when trying to diagnose an issue. Here’s what you currently see:


Thinking no problem, just use xp_readerrorlog? Nope!


Don’t worry. Microsoft already knows about this and these things are expected. It is a CTP after all… 

How to read the log

Reading the log from the Linux cmd prompt is an easy one line command. Assuming the logs are in the default install folder, simply run the following:

less /var/opt/mssql/log/errorlog

This simple command will display the errorlog in the command window and allow you to scroll up and down. Press CTRL-Z to exit less.

So in this case, LESS gives you more.



Be sure to follow me on Twitter and LinkedIn and check out my other blog posts.

Confessions of a Microsoft Addict

Daniel Janik has been supporting SQL Server for 18 years as a DBA, developer, architect, and consultant. He spent six years at Microsoft Corporation supporting SQL Server as a Senior Premier Field Engineer (PFE) where he supported over 287 different clients with both reactive and proactive database needs. Daniel has spoken at several SQL Saturday events across the US and Caribbean and regularly speaks at PASS local chapters.


Leave a comment on the original post [sqltechblog.com, opens in a new window]

Loading comments...