aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/logs.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py
index fc3096ea..f7bb667a 100644
--- a/sos/plugins/logs.py
+++ b/sos/plugins/logs.py
@@ -25,7 +25,8 @@ class Logs(Plugin):
def setup(self):
self.add_copy_spec([
"/etc/syslog.conf",
- "/etc/rsyslog.conf"
+ "/etc/rsyslog.conf",
+ "/etc/rsyslog.d"
])
self.limit = self.get_option("log_size")
@@ -79,15 +80,20 @@ class DebianLogs(Logs, DebianPlugin, UbuntuPlugin):
def setup(self):
super(DebianLogs, self).setup()
- self.add_copy_spec([
- "/var/log/syslog",
- "/var/log/udev",
- "/var/log/kern*",
- "/var/log/mail*",
- "/var/log/dist-upgrade",
- "/var/log/installer",
- "/var/log/unattended-upgrades"
- ])
+ if not self.get_option("all_logs"):
+ limit = self.get_option("log_size")
+ self.add_copy_spec_limit("/var/log/syslog", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/syslog.1", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/kern.log", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/kern.log.1", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/udev", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/dist-upgrade", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/installer", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/unattended-upgrades",
+ sizelimit=limit)
+ self.add_cmd_output('ls -alRh /var/log/')
+ else:
+ self.add_copy_spec("/var/log/")
# vim: et ts=4 sw=4