docker 日志从 .NET Core 控制台应用程序输出 [英] Output from .NET Core console app by docker logs

查看:48
本文介绍了docker 日志从 .NET Core 控制台应用程序输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否应该使用 docker logs 命令从我的 .NET Core 控制台应用程序(linux 映像)中看到控制台输出 (Console.WriteLine)?

Should I see console output (Console.WriteLine) from my .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

这篇关于docker 日志从 .NET Core 控制台应用程序输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆