diff options
author | Vadim Kravcenko <bndrzz@gmail.com> | 2014-03-21 18:28:39 +0100 |
---|---|---|
committer | Vadim Kravcenko <bndrzz@gmail.com> | 2014-03-21 18:28:39 +0100 |
commit | c4b92fc759dcbf1c9459fbf06174d529e731aa3a (patch) | |
tree | 554a9ad14f9cf2f614d1f256a246f9edea75331e | |
parent | 98e907f879911881e46269197ba45bfd8b3378d0 (diff) |
Update ngxtop.py
Use the log file from config only when not supplied with --access-log option, else it is overwritten everytime, even when --access-log option is provided.
-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 |