# Using kubectl logs to read the SQL Server Error Log in Kubernetes

DevFeed: [Using kubectl logs to read the SQL Server Error Log in Kubernetes](<https://devfeed.tech/articles/using-kubectl-logs-to-read-the-sql-server-error-log-in-kubernetes-17515.md>)

Original publisher: [Read original article](<https://www.nocentino.com/posts/2019-09-14-using-kubectl-logs-follow-to-read-the-sql-server-error-log-in-kubernetes/>)

Author: Anthony Nocentino

Published: 2019-09-14T14:56:52Z

Content type: tutorial

Language: en

Sources: [Kubernetes on Anthony Nocentino's Blog](<https://devfeed.tech/sources/kubernetes-on-anthony-nocentino-s-blog.md>)

Topics: [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [kubectl](<https://devfeed.tech/topics/kubectl.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>), [Containers](<https://devfeed.tech/topics/containers.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>)

Tags: [containers](<https://devfeed.tech/tags/containers.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [kubectl](<https://devfeed.tech/tags/kubectl.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [linux](<https://devfeed.tech/tags/linux.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>)

## AI overview

A tutorial showing how to use kubectl logs and the follow flag to read the SQL Server Error Log from a SQL Server container running in Kubernetes. It explains how to view current output, continuously follow the log, and monitor a database restore.

## Source excerpt

When working with SQL Server running containers the Error Log is written to standard out. Kubernetes will expose that information to you via kubectl. Let's check out how it works. If we start up a Pod running SQL Server and grab the Pod name kubectl get pods NAME READY STATUS RESTARTS AGE mssql-deployment-56d8dbb7b7-hrqwj 1/1 Running 0 22m We can usefollow flag and that will continuously write the error log to your console, similar to using tail with the -f option. If you remove the follow flag it will write the current log to your console. This can be useful in debugging failed startups or in the case below, monitoring the status of a database restore. When finished you can use CTRL+C to break out and return back to your prompt.