log - add LOG_LEVEL variable

This commit is contained in:
florian 2021-05-18 21:51:13 +02:00
parent 73543f4b0e
commit 96db3a450d
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
5 changed files with 11 additions and 3 deletions

View File

@ -53,7 +53,7 @@ http {
# write logs to local syslog
log_format logf '%LOG_FORMAT%';
access_log /var/log/access.log logf;
error_log /var/log/error.log info;
error_log /var/log/error.log %LOG_LEVEL%;
# temp paths
proxy_temp_path /tmp/proxy_temp;

View File

@ -9,7 +9,7 @@ local bad_behavior_count_time = %BAD_BEHAVIOR_COUNT_TIME%
local bad_behavior_ban_time = %BAD_BEHAVIOR_BAN_TIME%
if use_bad_behavior then
behavior.count(bad_behavior_status_code, bad_behavior_threshold, bad_behavior_count_time, bad_behavior_ban_time)
behavior.count(bad_behavior_status_codes, bad_behavior_threshold, bad_behavior_count_time, bad_behavior_ban_time)
end
}

View File

@ -69,6 +69,12 @@ Default value : *$host $remote_addr - $remote_user \[$time_local\] "$request" $s
Context : *global*
The log format used by nginx to generate logs. More info [here](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format).
`LOG_LEVEL`
Values : *debug, info, notice, warn, error, crit, alert, or emerg*
Default value : *info*
Context : *global*
The level of logging : *debug* means more logs and *emerg* means less logs. More info [here](https://nginx.org/en/docs/ngx_core_module.html#error_log).
`HTTP_PORT`
Values : *\<any valid port greater than 1024\>*
Default value : *8080*

View File

@ -2,6 +2,7 @@
MULTISITE="${MULTISITE-no}"
LOG_FORMAT="${LOG_FORMAT-\$host \$remote_addr - \$remote_user [\$time_local] \"\$request\" \$status \$body_bytes_sent \"\$http_referer\" \"\$http_user_agent\"}"
LOG_LEVEL="${LOG_LEVEL-info}"
HTTP_PORT="${HTTP_PORT-8080}"
HTTPS_PORT="${HTTPS_PORT-8443}"
MAX_CLIENT_SIZE="${MAX_CLIENT_SIZE-10m}"

View File

@ -66,8 +66,9 @@ else
replace_in_file "/etc/nginx/nginx.conf" "%MULTISITE_DEFAULT_SERVER%" ""
fi
# custom log format
# logging
replace_in_file "/etc/nginx/nginx.conf" "%LOG_FORMAT%" "$LOG_FORMAT"
replace_in_file "/etc/nginx/nginx.conf" "%LOG_LEVEL%" "$LOG_LEVEL"
# proxy_cache zone
if [ "$(has_value USE_PROXY_CACHE yes)" != "" ] ; then