aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2017-08-31 17:00:38 +0200
committerBryn M. Reeves <bmr@redhat.com>2017-10-27 14:18:52 +0100
commit81b2623ea9386335cf2dd59e299861c22155b75c (patch)
tree33dd8e488cdb912c47eccde2b8e537888a8e7083
parent92a600a91f7eb3b0525c891ce844f2ca1877fc7b (diff)
downloadsos-81b2623ea9386335cf2dd59e299861c22155b75c.tar.gz
[apache] plugin shall apply --all-logs option
--all-logs is currently ignored by the plug-in. Related to: #1083 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/apache.py38
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 :