Using kubectl logs to read the SQL Server Error Log in Kubernetes
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.

