Is there an easy way to reduce HTTP request logging? #22076
-
|
Currently it seems that the nginx setup in the frigate container logs every request to stdout regardless if it is successful or failed. This clutters docker logs especially with health probes. Is there an option to cut down on the logs without messing with nginx configuration files inside the image? Images used is stable-tensorrt logging:
default: warningdid not change anything |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
The To reduce nginx logging without modifying files inside the container, you can use a bind mount or volume map of Frigate's nginx config(2). You could check the user agent header and disable logging specifically for your health probe requests(2). For example, you could create a custom nginx configuration that filters out requests from your "Blackbox-Exporter" user agent, then mount it over the default nginx config location(3). When testing nginx config changes, you can copy and reload the config with: sudo cp docker/main/rootfs/usr/local/nginx/conf/* /usr/local/nginx/conf/ && sudo /usr/local/nginx/sbin/nginx -s reloadHowever, there isn't a built-in Frigate configuration option to control nginx access logging without customizing the nginx configuration files. 📚 Sources:
Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
created a workaround that creates a custom docker image by patching existing nginx.conf FROM ghcr.io/blakeblackshear/frigate:stable-tensorrt
COPY ./script.sh /script.sh
RUN chmod +x /script.sh && /script.sh /usr/local/nginx/conf/nginx.conf && rm /script.sh#!/bin/bash
CONFIG_FILE="$1"
if [[ ! -f "$CONFIG_FILE" ]]; then
echo "File not found: $CONFIG_FILE"
exit 1
fi
# Insert 'access_log off;' after the first 'http {' line
sed -i '/http\s*{/a \
access_log off;' "$CONFIG_FILE" |
Beta Was this translation helpful? Give feedback.
created a workaround that creates a custom docker image by patching existing nginx.conf