Docker Community Forums

Share and learn in the Docker community.

Docker duplicates logs?

Hi all,
I wanted to know the disk usage on my docker node, so I used the following command :

du -ha --max-depth=10 --threshold=10M /data | sort -nr

And I saw strange things in the result :
first the json log for my container in $rootdir/containers/<containerID>/<containerID>-json.log was growing endlessly. I found the way to rectify this with the log configuration in the daemon.json file. So it’s done for this part.
But I also saw that my application logs are duplicated. My springboot application in my container writes logs in /app/logs (with log rotation up to 10 files in /app/logs/archived).
As you can see below, the log files are duplicated in
$rootdir/overlay2/<someID??>/diff/app/logs/archived/ and $rootdir/overlay2/<someID??/merged/app/logs/archived/

here is the complete listing

3,8G	/data/docker/containers/9851adc3cea03fe2fd130f0768683bcb706da3d342c4ddc2d3e459a971182447/9851adc3cea03fe2fd130f0768683bcb706da3d342c4ddc2d3e459a971182447-json.log
12M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.17.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.18.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.19.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.20.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.21.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.22.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.23.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.24.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/diff/app/logs/archived/pbc-app.2021-02-02.25.log
12M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.17.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.18.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.19.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.20.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.21.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.22.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.23.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.24.log
11M	/data/docker/overlay2/79e90323d71dbd3742d18031bb2dfd02312fb8208b619aa0c734b25a382a9bd4/merged/app/logs/archived/pbc-app.2021-02-02.25.log

Is it normal ? why the logs are duplicated ?
Thanks