aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2018-05-09 14:41:36 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-05-09 14:41:36 +0100
commit5d25dd31e731cc0d2d09a1b242803373937b4863 (patch)
tree4b32132515f3c34b0bc2b9afdef935f290d02e6b
parent7bc90f618f0549279544d26effae2e5197d85e2b (diff)
downloadsos-5d25dd31e731cc0d2d09a1b242803373937b4863.tar.gz
[logs] implement --all-logs for Red Hat messages* and secure*
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/logs.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py
index c5e239b3..1563b59d 100644
--- a/sos/plugins/logs.py
+++ b/sos/plugins/logs.py
@@ -86,8 +86,15 @@ class RedHatLogs(Logs, RedHatPlugin):
def setup(self):
super(RedHatLogs, self).setup()
messages = "/var/log/messages"
- self.add_copy_spec("/var/log/secure*", sizelimit=self.limit)
- self.add_copy_spec(messages + "*", sizelimit=self.limit)
+ secure = "/var/log/secure"
+
+ if self.get_option("all_logs"):
+ messages += "*"
+ secure += "*"
+
+ self.add_copy_spec(secure, sizelimit=self.limit)
+ self.add_copy_spec(messages, sizelimit=self.limit)
+
# collect three days worth of logs by default if the system is
# configured to use the journal and not /var/log/messages
if not os.path.exists(messages) and self.is_installed("systemd"):