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:

image

Thinking no problem, just use xp_readerrorlog? Nope!

image

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s