The logs in my MB Virtual Machine gets longer and longer with
docker-compose logs
How can I delete one specific (or all the) logs?
The logs in my MB Virtual Machine gets longer and longer with
docker-compose logs
How can I delete one specific (or all the) logs?
Docker provides options for log rotation. See this question on Stack Overflow:
I think to use this with docker-compose it needs to be set in the compose.yml as described at https://docs.docker.com/compose/compose-file/#/logging
Something like this should probably do for having maximum 10 log files with 10MB each (have never tried it myself):
logging:
driver: json-file
options:
max-size: 10m
max-file: 10
Would be nice to have this set in the official VM right from the start
Thank you very much @outsidecontext !
Do I have to add this logging: section to every existing section in the file docker-compose.yml?
(Once for âsearchâ, once for âmusicbrainzâ, once for âpostgresqlâ and so on)? Or just as one single addition at the end of the file?
âPRs welcomeâ
(I just took a look, but I couldnât figure out where it should go at a glance. In the Vagrantfile maybe?)
Yes, I think so. Donât know if there is a way to set it globally.
Itâs in musicbrainz-docker/docker-compose.yml at master ¡ mayhem/musicbrainz-docker ¡ GitHub Letâs see if it works for @InvisibleMan78, if it does someone can open a PR
I would tell you if it works, but how can I test it?
I can add your code snippet to every section, save the file and restart everything.
But how can I be sure if it doesnât create more then 10 log files and each not bigger then 10 MB?
And BTW:
This doesnât solve my initial problem. Even with 10 logfiles Ă 10MB the startup-process showing all my previous replication steps and all my local search attempts spend already several minutes until the scrolling stops
If this scrolling is still about the logs you can of course reduce the logs even more or disable them completely (driver: none
). If it is not about the logs, well, at least you have fixed the log file size issue
Unfortunately I get the following error for every section using the command
docker-compose start
ERROR: Validation failed in file './docker-compose.yml', reason(s):
Unsupported config option for indexer: 'driver'
Unsupported config option for musicbrainz: 'driver'
...
Any other ideas?
I just realized the docker-compose.yml is a v1, not a v2 file. In that case the syntax is a bit different, the snippet below does the same as above, but different configuration keys for v1 compose files:
log_driver: json-file
log_opt:
max-size: 10m
max-file: 10