问题
Should I see console output (Console.WriteLine) from .net core console app dockerized (linux image) by using docker logs command?
回答1:
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
回答2:
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
来源:https://stackoverflow.com/questions/48029317/output-from-net-core-console-app-by-docker-logs