I have a standalone Rancher instance running on Docker (not in a cluster), and I've just discovered that the JSON log file for one of the containers has ballooned to about 10.2 GB. I'm trying to find guidance on how to manage or rotate this log file. I've searched through Rancher's documentation and various resources but haven't found anything specific to my setup. I'm looking for methods to handle the logging in Rancher without causing issues. The log file path is /var/lib/docker/containers/asdfaserfflongstringoftext/asdfaserfflongstringoftext-json.log. Any advice would be appreciated!
1 Answer
You should definitely use logrotate for handling those large log files. It’s pretty straightforward and really effective. Here's a helpful guide on it: [logrotate tutorial](https://www.baeldung.com/linux/rotating-logs-logrotate). Just set it to rotate and compress those logs regularly to keep your disk usage in check. It's a solid approach!

Got it! But how do I ensure that the Rancher application picks up the new log file after it's rotated? I've used logrotate before, but I’m not sure how it works specifically in a Docker container setup.