Update nginx logging paths in configuration and Frigate HTTP module to differentiate between access and error logs

This commit is contained in:
Sergey Krashevich 2023-06-19 23:36:38 +03:00
parent 7c1568fcb9
commit b42cf37d92
No known key found for this signature in database
GPG Key ID: 625171324E7D3856
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ daemon off;
user root;
worker_processes auto;
error_log /dev/stdout warn;
error_log /dev/shm/logs/nginx/error_log warn;
pid /var/run/nginx.pid;
events {
@ -17,7 +17,7 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
access_log /dev/shm/logs/nginx/access_log main;
# send headers in one piece, it is better than sending them one by one
tcp_nopush on;

View File

@ -1611,7 +1611,7 @@ def logs(service: str):
log_locations = {
"frigate": "/dev/shm/logs/frigate/current",
"go2rtc": "/dev/shm/logs/go2rtc/current",
"nginx": "/dev/shm/logs/nginx/current",
"nginx": "/dev/shm/logs/nginx/error_log" if current_app.frigate_config.logger.default in ["warning", "error", "critical"] else "/dev/shm/logs/nginx/access_log",
}
service_location = log_locations.get(service)