Output from .net core console app by docker logs

2020-04-03 14:44发布

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

2条回答
Juvenile、少年°
2楼-- · 2020-04-03 15:12

Yes. You can see logs written to stdout and stderr if you use the default logging driver.

By default, docker logs shows the command’s STDOUT and STDERR.

View logs for a container or service

查看更多
女痞
3楼-- · 2020-04-03 15:20

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

查看更多
登录 后发表回答