How do I access the Windows Event Log of a Microsoft Docker container from the host?
I have a docker container under Windows Server 2016.
The container is based on image: microsoft/iis
I can get the ip address of the container with:
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" my-running-site
How can I connect to it via the Event Viewer on the windows host?
On PWSH (Powershell Core):
Create a powershell session for the container
Then from the container, get the latest event logs
Above command will help you to find the index,
The Docker Engine logs to the Windows 'Application' event log, rather than to a file. These logs can easily be read, sorted, and filtered using Windows PowerShell
For example, this will show the Docker Engine logs from the last 5 minutes starting with the oldest.