summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh Le <lebinh.it@gmail.com>2014-03-24 23:57:18 +0700
committerBinh Le <lebinh.it@gmail.com>2014-03-24 23:57:18 +0700
commit0dd66177e1c9b97bd60a244e36e404c3381b47f4 (patch)
treed3d299175593d895bed072ec1fb39442743c94d2
parentb1a6803a5a46527351dd0fd784abd333b7c74297 (diff)
Change default log location to '/var/log/nginx/access.log' as it's the default in Debian / Ubuntu.
-rwxr-xr-xngxtop/ngxtop.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ngxtop/ngxtop.py b/ngxtop/ngxtop.py
index f9d5a0c..74f044f 100755
--- a/ngxtop/ngxtop.py
+++ b/ngxtop/ngxtop.py
@@ -159,7 +159,7 @@ def extract_nginx_conf(path, log_file=None, log_format=None):
# 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'
+ log_file = access_log_directive.group(1) if access_log_directive else '/var/log/nginx/access.log'
return log_file, log_format
@@ -176,6 +176,8 @@ def build_pattern(log_format):
def extract_variables(log_format):
+ if log_format == 'combined':
+ log_format = LOG_FORMAT_COMBINED
for match in re.findall(REGEX_LOG_FORMAT_VARIABLE, log_format):
yield match