From b42cf37d92e04f847521dd34bc5e02d26fe304cd Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Mon, 19 Jun 2023 23:36:38 +0300 Subject: [PATCH] Update nginx logging paths in configuration and Frigate HTTP module to differentiate between access and error logs --- docker/rootfs/usr/local/nginx/conf/nginx.conf | 4 ++-- frigate/http.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/rootfs/usr/local/nginx/conf/nginx.conf b/docker/rootfs/usr/local/nginx/conf/nginx.conf index 35703fb2c..399808153 100644 --- a/docker/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/rootfs/usr/local/nginx/conf/nginx.conf @@ -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; diff --git a/frigate/http.py b/frigate/http.py index b4813c1f2..dd93e0c51 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -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)