microsoft / iis-docker

Dockerfile for IIS
https://hub.docker.com/r/microsoft/iis/
MIT License
288 stars 128 forks source link

asp.net application logs to std out #153

Closed sumantfordev closed 5 years ago

sumantfordev commented 5 years ago

is there a way to forward all asp.net application logs to std out

bariscaglar commented 5 years ago

Currently, no easy way, not unless you write a forwarder. which isn't easy. I am aware of an effort by the Windows team to do this natively, although I don't have a timeline or the details. There's also a prototype on GitHub called "Metric Hub" if you want to take a look at how one such forwarder can be written.

sumantfordev commented 5 years ago

Thanks for the response, since logs/errors to std out for a docker container is a standard aproach followed, so i am looking forward for this option for windows containers. Can you share any link for metric hub,

For now what i have planned is to use log4net with a udp log appender , and my container startup script is running a udp listener that continuously writes log to console. Since entry point is the script, stdout is attached to script output.

bariscaglar commented 5 years ago

https://github.com/bangbingsyb/MetricHub is the link. This is just a prototype to give you an idea of how one such system could work. If you were to take IIS out of the picture and go to .net core and self hosting, then you could directly log to stdout from your self-hosted application if I am not mistaken. The point is that the entry point application should be the one doing the stdout and not any other binary. IIS uses servicemonitor, which could also be extended to have that kind of functionality. MetricHub, by the way, uses the latter approach, replacing servicemonitor with the added features.