fradelg / docker-mysql-cron-backup

Docker image to backup all your databases periodically
Apache License 2.0
305 stars 111 forks source link

Move mysql_backup.log to var/log #44

Closed chiqui3d closed 3 years ago

chiqui3d commented 3 years ago

Hello!,

I would like to mount the mysql_backup.log file on the host, that way I can manage it with a log provider like ELK, I don't know if I'm wrong but as the file is in the root directory I have no choice than to mount the full system.

Is it possible to move it to the /var/log directory?

I don't know if there is a better way to manage the logs in production.

fradelg commented 3 years ago

Everything should be tailed to the stdout of the container so it is available through docker logs. Then, you can fetch the log file from the host directory where the logs of your container are stored (usually /var/lib/docker/containers/<container_id>/<container_id>-json.log) or use the ELK stack to scrap the new lines from there.

chiqui3d commented 3 years ago

Thank you very much @fradelg, I finally did that, but ELK could not install it on my PC to test it (it consumes a lot of resources), so I am with Grafana and Loki who has a plugin for docker logging.