lebinh / ngxtop

Real-time metrics for nginx server
MIT License
6.49k stars 473 forks source link

How to read log from Nginx Docker #94

Open Maatary opened 6 years ago

Maatary commented 6 years ago

The official Nginx Docker image does a redirection of access.log to /dev/stdout, so that one can access the log with docker log from outside docker i.e. on the host. This is an issue because then from within the docker container I can't access access.log.

I finally resorted to install nginx on my mac and perform the following command docker logs -f competent_edison &>> ~/Dev/monitoring/access.log

While the redirection works fine and the access.log on my mac, mirror the output of the container in realtime, ngxtop output nothing when i pass that file as parameter: ngnix -l ~/Dev/monitoring/access.log

I wonder if there is a way for ngxtop to be installed on an host, to monitor an nginx running in a container.

Please any indication would be helpful as i spend 2 days around that and can't figure out how to deal with it.

cmjzzx commented 2 years ago

@Maatary Hi, has this problem been solved?