diff options
author | Binh Le <lebinh.it@gmail.com> | 2014-03-22 00:35:13 +0700 |
---|---|---|
committer | Binh Le <lebinh.it@gmail.com> | 2014-03-22 00:35:13 +0700 |
commit | 87ca10d180b48f4783bcd06ffbde4a2dc2324478 (patch) | |
tree | 554a9ad14f9cf2f614d1f256a246f9edea75331e | |
parent | 98e907f879911881e46269197ba45bfd8b3378d0 (diff) | |
parent | c4b92fc759dcbf1c9459fbf06174d529e731aa3a (diff) |
Merge pull request #4 from bndr/patch-1
--access-log option overwritten everytime
-rwxr-xr-x | ngxtop.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -150,7 +150,10 @@ def extract_nginx_conf(path, log_file=None, log_format=None): log_format = log_format.replace("'", "") access_log_directive = re.search(r'access_log\s+(\S+)\s+%s' % log_format_name, conf) - log_file = access_log_directive.group(1) if access_log_directive else 'logs/access.log' + # Use the log file from config only when not supplied with --access-log option, + # else it is overwritten everytime. + if not log_file: + log_file = access_log_directive.group(1) if access_log_directive else 'logs/access.log' return log_file, log_format |