diff options
-rw-r--r-- | sos/plugins/logs.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py index 592671c3..5d693abf 100644 --- a/sos/plugins/logs.py +++ b/sos/plugins/logs.py @@ -29,7 +29,8 @@ class Logs(Plugin): "/etc/rsyslog.d" ]) - self.limit = self.get_option("log_size") + self.limit = (None if self.get_option("all_logs") + else self.get_option("log_size")) self.add_copy_spec("/var/log/boot.log", sizelimit=self.limit) self.add_copy_spec("/var/log/cloud-init*", sizelimit=self.limit) self.add_journal(boot="this") @@ -93,15 +94,15 @@ class DebianLogs(Logs, DebianPlugin, UbuntuPlugin): def setup(self): super(DebianLogs, self).setup() if not self.get_option("all_logs"): - limit = self.get_option("log_size") - self.add_copy_spec("/var/log/syslog", sizelimit=limit) - self.add_copy_spec("/var/log/syslog.1", sizelimit=limit) - self.add_copy_spec("/var/log/kern.log", sizelimit=limit) - self.add_copy_spec("/var/log/kern.log.1", sizelimit=limit) - self.add_copy_spec("/var/log/udev", sizelimit=limit) - self.add_copy_spec("/var/log/dist-upgrade", sizelimit=limit) - self.add_copy_spec("/var/log/installer", sizelimit=limit) - self.add_copy_spec("/var/log/unattended-upgrades", sizelimit=limit) + self.add_copy_spec("/var/log/syslog", sizelimit=self.limit) + self.add_copy_spec("/var/log/syslog.1", sizelimit=self.limit) + self.add_copy_spec("/var/log/kern.log", sizelimit=self.limit) + self.add_copy_spec("/var/log/kern.log.1", sizelimit=self.limit) + self.add_copy_spec("/var/log/udev", sizelimit=self.limit) + self.add_copy_spec("/var/log/dist-upgrade", sizelimit=self.limit) + self.add_copy_spec("/var/log/installer", sizelimit=self.limit) + self.add_copy_spec("/var/log/unattended-upgrades", + sizelimit=self.limit) self.add_cmd_output('ls -alRh /var/log/') else: self.add_copy_spec("/var/log/") |