microsoft / windows-container-tools

Collection of tools to improve the Windows Containers experience
MIT License
244 stars 70 forks source link

How non entry point (random) process running inside Windows Container could write to docker default log output (stdout)? #15

Open sanguedemonstro opened 4 years ago

sanguedemonstro commented 4 years ago

Hi, first of all, thank's for this project. It's awesome to finally bring Windows Applications to container.

So, I have one Windows Container with various processes, .NET and Win32 legacy applications.

First scenario

Entry point calls myConfigurator.exe, who calls first.exe, who creates a pool of second.exe process

Second scenario

Entry point calls myConfigurator.exe, who calls ServiceMonitor.exe, who initialize my IIS ASP.NET Web Application, who creates a pool of second.exe process

Problem

I'm already using log4net appender to send all logs to elasticsearch, and it's all good. But, I need to send logs to default docker log too, so datacenter operators can see logs the same way they do with standard/compliant containers, using docker logs, or portainer or any other container tool.

Question

algamaes commented 4 years ago

Hi @sanguedemonstro. What kind of logs are you trying to log (EventLogs, log files, ETW or the stdout of the processes)?

I'm asking this because for EventLogs and ETW, you can specify any channel or provider, and for the log files, you can specify any folder. These aren’t process attached.

Currently, there is no way to log stdout of processes different to the entry point (there's another open issue for what I think you're asking), but you could always send the stdout to a file, and monitor it with the ‘log file’ type.

sanguedemonstro commented 4 years ago

@algamaes In my case I need to somehow listen to stdout of some specific processes (more than one, and non "entrypointed") running inside Windows container.

One of those processes is 3rd party, so I can not change it..

iankingori commented 2 years ago

Link #28