#Help Understanding Slog file rotation
6 messages · Page 1 of 1 (latest)
Hi 👋 ! slog doesn't file rotation.
They didn't add that because it's not part of actual logging. There are very common tools on various systems that already offers this and there are 3rd party Go modules that have log file rotation.
https://github.com/natefinch/lumberjack
This one is quite popular among Go developers.
Thank, you. I really appreciate the help. I'll look into lumberjack as a potential option
It's common for tools outside of applications to handle log rotation.
Log rotation is solved by a program called logrotate on BSD and Linux systems.
If you run in Kubernetes, the rotation is handled by whatever solution you have for capture stdout and stderr.
I see. This is very helpful. I'm early in my Go career (my career in general) and so this is all very useful information going forward. I appreciate it
You're welcome.
Don't hesitate to ask questions. 🙂