sameersbn / docker-apt-cacher-ng

Dockerfile to create a Docker container image for Apt-Cacher NG
MIT License
210 stars 72 forks source link

Log to stdout/docker #2

Closed strarsis closed 7 years ago

strarsis commented 8 years ago

It would be great if apt-cacher-ng could log to stdout so one can attach to the logs using docker logs to view the current requests made to it for debugging.

sameersbn commented 8 years ago

At the moment there is no such option. As a workaround you can do docker exec -it apt-cacher-ng tail -f /var/log/apt-cacher-ng/apt-cacher.log

silkentrance commented 8 years ago

@sameersbn in my dockerfile I create symlinks for both /var/log/apt-cacher-ng/apt-cacher.log and /var/log/apt-cacher-ng.err. Both then simply point to /dev/stdout and /dev/stderr, respectively.

sameersbn commented 7 years ago

Its been a while, but the thing about the symlinking is that it requires apt-cacher-ng to be launched as the root user. IMO it's not worth the risk.

docker exec -it apt-cacher-ng tail -f /var/log/apt-cacher-ng/apt-cacher.log is the recommended way to view the logs of the apt-cache-ng daemon in the image. I will document this option and close this issue.

sameersbn commented 7 years ago

actually it has already been documented. closing...