You do output your logs in
/dev/stdout
for all normal logs
use /dev/stderr
to pipe all the errors you have, if your application can differ between normal logs and error logs.
So instead of defining your log like /var/log/nohup.log
you define the logfile to be dev/stdout
Accessing the logs will then be as easy as writing docker logs <containername>
or docker-compose logs <servicename>
- if you have started your stack using docker-compose up
you will see the logs right in front of you anyway - very convenient.
In production grade you want to process the log stream further, look at https://github.com/gliderlabs/logspout
And if you want to go a level deeper, add the ELK stack to it https://logz.io/learn/complete-guide-elk-stack/