diff options
-rw-r--r-- | sos/plugins/apache.py | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/sos/plugins/apache.py b/sos/plugins/apache.py index c04fce9f..78a54411 100644 --- a/sos/plugins/apache.py +++ b/sos/plugins/apache.py @@ -55,22 +55,25 @@ class RedHatApache(Apache, RedHatPlugin): self.add_forbidden_path("/etc/httpd/conf/password.conf") + # determine how much logs to collect + self.limit = None if self.get_option("all_logs") else 5 + # collect only the current log set by default - self.add_copy_spec("/var/log/httpd/access_log", 5) - self.add_copy_spec("/var/log/httpd/error_log", 5) - self.add_copy_spec("/var/log/httpd/ssl_access_log", 5) - self.add_copy_spec("/var/log/httpd/ssl_error_log", 5) + self.add_copy_spec("/var/log/httpd/access_log", self.limit) + self.add_copy_spec("/var/log/httpd/error_log", self.limit) + self.add_copy_spec("/var/log/httpd/ssl_access_log", self.limit) + self.add_copy_spec("/var/log/httpd/ssl_error_log", self.limit) # JBoss Enterprise Web Server 2.x - self.add_copy_spec("/var/log/httpd22/access_log", 5) - self.add_copy_spec("/var/log/httpd22/error_log", 5) - self.add_copy_spec("/var/log/httpd22/ssl_access_log", 5) - self.add_copy_spec("/var/log/httpd22/ssl_error_log", 5) + self.add_copy_spec("/var/log/httpd22/access_log", self.limit) + self.add_copy_spec("/var/log/httpd22/error_log", self.limit) + self.add_copy_spec("/var/log/httpd22/ssl_access_log", self.limit) + self.add_copy_spec("/var/log/httpd22/ssl_error_log", self.limit) # Red Hat JBoss Web Server 3.x - self.add_copy_spec("/var/log/httpd24/access_log", 5) - self.add_copy_spec("/var/log/httpd24/error_log", 5) - self.add_copy_spec("/var/log/httpd24/ssl_access_log", 5) - self.add_copy_spec("/var/log/httpd24/ssl_error_log", 5) - if self.get_option("log"): + self.add_copy_spec("/var/log/httpd24/access_log", self.limit) + self.add_copy_spec("/var/log/httpd24/error_log", self.limit) + self.add_copy_spec("/var/log/httpd24/ssl_access_log", self.limit) + self.add_copy_spec("/var/log/httpd24/ssl_error_log", self.limit) + if self.get_option("log") or self.get_option("all_logs"): self.add_copy_spec([ "/var/log/httpd/*", # JBoss Enterprise Web Server 2.x @@ -90,10 +93,13 @@ class DebianApache(Apache, DebianPlugin, UbuntuPlugin): "/etc/default/apache2" ]) + # determine how much logs to collect + self.limit = None if self.get_option("all_logs") else 15 + # collect only the current log set by default - self.add_copy_spec("/var/log/apache2/access_log", 15) - self.add_copy_spec("/var/log/apache2/error_log", 15) - if self.get_option("log"): + self.add_copy_spec("/var/log/apache2/access_log", self.limit) + self.add_copy_spec("/var/log/apache2/error_log", self.limit) + if self.get_option("log") or self.get_option("all_logs"): self.add_copy_spec("/var/log/apache2/*") # vim: set et ts=4 sw=4 : |