aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-03-20 17:33:30 +0100
committerBryn M. Reeves <bmr@redhat.com>2019-03-21 12:45:27 +0000
commit21791dd2c68c0befe30c4b6614b57beb985439ca (patch)
tree4e8f5670ab94602be8dabc9f3c967e561c81edbd
parent870e1f82f65f4917baeb9e5c3e32aadc8773c8e7 (diff)
downloadsos-21791dd2c68c0befe30c4b6614b57beb985439ca.tar.gz
[apache] honour --log-size
Honour --log-size option for collecting logs and dont use the hardcoded 5/15MB size limit. Resolves: #1203 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/apache.py42
1 files changed, 20 insertions, 22 deletions
diff --git a/sos/plugins/apache.py b/sos/plugins/apache.py
index 2c6776bc..390478ef 100644
--- a/sos/plugins/apache.py
+++ b/sos/plugins/apache.py
@@ -54,24 +54,23 @@ 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", 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", 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", 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)
+ self.add_copy_spec([
+ "/var/log/httpd/access_log",
+ "/var/log/httpd/error_log",
+ "/var/log/httpd/ssl_access_log",
+ "/var/log/httpd/ssl_error_log",
+ # JBoss Enterprise Web Server 2.x
+ "/var/log/httpd22/access_log",
+ "/var/log/httpd22/error_log",
+ "/var/log/httpd22/ssl_access_log",
+ "/var/log/httpd22/ssl_error_log",
+ # Red Hat JBoss Web Server 3.x
+ "/var/log/httpd24/access_log",
+ "/var/log/httpd24/error_log",
+ "/var/log/httpd24/ssl_access_log",
+ "/var/log/httpd24/ssl_error_log",
+ ])
if self.get_option("log") or self.get_option("all_logs"):
self.add_copy_spec([
"/var/log/httpd/*",
@@ -92,12 +91,11 @@ 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", self.limit)
- self.add_copy_spec("/var/log/apache2/error_log", self.limit)
+ self.add_copy_spec([
+ "/var/log/apache2/access_log",
+ "/var/log/apache2/error_log",
+ ])
if self.get_option("log") or self.get_option("all_logs"):
self.add_copy_spec("/var/log/apache2/*")