Closed shirhatti closed 4 years ago
I would suggest instead use ETW events and consume them instead of tailing physical file log for multiple reasons.
Agreed. I'm leaning to use ETW as well and we will verify this hypothesis before implementation.
Re-opening this issue per feedback in https://github.com/Microsoft/IIS.ServiceMonitor/pull/20#issuecomment-399576040
The plan is to have a reusable module that listens on the IIS ETW events and writes to an output stream. The design will be similar to that of w3logsvc.
The previous attempt printed IIS log file data. I do agree this should be written to stdout, but I think there is a greater need here for overall control of stdout from an IIS worker process inside the container. As an example, we are using NLog extensively in a .NET Framework ASP.NET application and would like to add our own application log data to the output of the container as well.
ASP.Net logs app crashes to the Application event log. Don't we need some type of facility to port ETW messages from container to host?
Any plans on implementing this feature?
Any update? Running IIS via this image in Kubernetes and not being able to to do kubectl logs
is a huge headache. How do people use this image without logs?
I can't believe this issue still hasn't been resolved!
Any update? Running IIS via this image in Kubernetes and not being able to to do
kubectl logs
is a huge headache. How do people use this image without logs?
You could have a sidecar which tails the IIS access logs to stdout. It's far from ideal - I know.
Seems like this new "LogMonitor" tool can be configured to listen these IIS logs or events : https://github.com/microsoft/windows-container-tools/tree/master/LogMonitor
I do not have myself a Dockerized Windows IIS based application, but if anyone try it, it would be gread to share the LogMonitor instruction configured in his DockerFile to monitor IIS.
We have implemented an experimental tag at https://github.com/microsoft/iis-docker/blob/master/windowsservercore-insider/Dockerfile which uses the logmonitor to fix this issue. If using logmonitor become commont for most users, we are going to integrate the tool to the existing or new official IIS tags. See https://blogs.iis.net/jeonghwan/how-to-use-iis-insider-docker-tag for the detail.
@jhkimnew Love it, this is exactly what we've been looking for. I can now see ETW events in my containers console. Looking at https://github.com/microsoft/windows-container-tools/blob/master/LogMonitor/src/LogMonitor/sample-config-files/IIS/LogMonitorConfig.json I can see how to configure more file/ETW log sources but there isn't much in the way of documentation - could do with some more examples.
The big question though is can I configure the STDOUT of my web application to appear in the console? I really don't want the container to waste time writing to log files and then thunking them to STDOUT with LogMonitor - I just want the STDOUT stream of the web app redirected to the container output. Any input much appreciated.
Based on feedback from @artisticcheese in https://github.com/Microsoft/iis-docker/issues/44, we should consider writing w3c logs to stdout.