jammsen / docker-palworld-dedicated-server

Docker container to easily provision and manage Palworld Dedicated Server
https://hub.docker.com/r/jammsen/palworld-dedicated-server
MIT License
897 stars 151 forks source link

feat: log rotation #261

Closed Gornoka closed 2 months ago

Gornoka commented 2 months ago

This Pr adds log rotation as the default log driver does not include it.

This is nice when your server goes into a crash loop and creates lots of logs in the process.

The values are set very high so that under normal circumstances you should not be affected by the rotation, it is meant more as a backstop in case somethnig goes very wrong

further reference: https://docs.docker.com/config/containers/logging/configure/

jammsen commented 2 months ago

Hey @Gornoka Thanks for the contribution, i very much like the idea, i even have this already implemented in my own setup. Im not sure if this still applies, because i did it way back from the old days of docker 19.03 and before, but dont we need a config file that sets the general log-driver to json with auto-log-rotate, or was this just to enable it be default for all? Im not sure anymore and my old bookmarks links arent existing anymore, so i cant research this up again.

Gornoka commented 2 months ago

Hey @Gornoka Thanks for the contribution, i very much like the idea, i even have this already implemented in my own setup. Im not sure if this still applies, because i did it way back from the old days of docker 19.03 and before, but dont we need a config file that sets the general log-driver to json with auto-log-rotate, or was this just to enable it be default for all? Im not sure anymore and my old bookmarks links arent existing anymore, so i cant research this up again.

IIRC the global config option only applies if there is no config specified in the individual compose file. Therefore we would not have to alter the global logging config.

This is the relevant article for global logging settings and the hint to use the local logger instead of the json logger: https://docs.docker.com/config/containers/logging/configure/

jammsen commented 2 months ago

Thanks for the contribution, but next time please do a PR against develop.

Gornoka commented 2 months ago

sorry my old fork did not have that branch yet