How to Manage Large Rancher Container Log Files?

0
4
Asked By CuriousCat42 On

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

Answered By LogMasterX On

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!

TechieTim -

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.