Viewing container logs - dbafromthecold/SqlServerAndContainersGuide GitHub Wiki

In order to troubleshoot issues or confirm settings the docker command, docker container logs is really useful.

Let's spin up a container: -

docker container run -d `
--publish 15789:1433 `
--env ACCEPT_EULA=Y `
--env SA_PASSWORD=Testing1122 `
--name sqlcontainer1 `
mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04

Run the following to view the logs: -

docker container logs sqlcontainer1

/images/7.DockerCommands/ViewingContainerLogs/1.DockerContainerLog.png

And there's the SQL error log! Really handy when troubleshooting issues.