Docker日志从.net核心控制台应用程序输出

Docker日志从.net核心控制台应用程序输出

问题描述:

我是否应该使用docker logs命令从.net核心控制台应用程序的控制台输出(Console.WriteLine)Dockerized(Linux映像)?

Should I see console output (Console.WriteLine) from .net core console app dockerized (linux image) by using docker logs command?

发现,在调试模式下,应用程序仅写入调试输出控制台.因此,如果您在本地调试容器上运行docker logs,将一无所获.如果以发布模式运行容器,则在运行docker logs

Found out that in debug mode the app only writes to the debug output console. So if you run docker logs on a local debugging container there will be nothing. If you run the container in release mode then the logs will be present when running a docker logs