From 94ef7bf746eccb60bd396b180640fb99ec0f9403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20M=C3=A9ndez=20Hern=C3=A1ndez?= Date: Fri, 15 Aug 2025 17:38:42 +0200 Subject: [PATCH] =?UTF-8?q?[foreman]=C2=A0Allow=20to=20set=20size=20limit?= =?UTF-8?q?=20instead=20of=20hardcoding=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow the possibility to provide the `sizelimit` value using the `log_size` option. Set it by default (when no option is provided) to the current value (500). Signed-off-by: Pablo Mendez Hernandez --- sos/report/plugins/foreman.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sos/report/plugins/foreman.py b/sos/report/plugins/foreman.py index 1d00d594aa..eff6d53bbc 100644 --- a/sos/report/plugins/foreman.py +++ b/sos/report/plugins/foreman.py @@ -91,10 +91,15 @@ def setup(self): _host_f = self.exec_cmd('hostname -f')['output'] _host_f = _host_f.strip() + if not self.get_option("log_size"): + limit = 500 + else: + limit = self.get_option("log_size") + self.add_copy_spec([ "/var/log/foreman/production.log", f"/var/log/{self.apachepkg}*/foreman-ssl_*_ssl.log" - ], sizelimit=500) + ], sizelimit=limit) # Allow limiting these self.add_copy_spec([