-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/Feature: Nginx respect logger configuration (sometimes) #6852
Fix/Feature: Nginx respect logger configuration (sometimes) #6852
Conversation
…o differentiate between access and error logs
✅ Deploy Preview for frigate-docs canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not going to work, it will fragment the error log and access log meaning a user can only have one or the other but not both enabled at the same time.
Also, the S6 logger is still enabled which would likely cause conflicts
I quickly understood it and rolled out the fix)
S6 logger watch to stdout/stderr. When there's nothing in them, it doesn't write anything |
0415ee7
to
610ef2a
Compare
610ef2a
to
67bf3a4
Compare
NB: Nginx, when it receives an HUP signal, not only reload its configs, but also re-opens file descriptors, including logs |
I think it would be preferable to have this logic before NGINX starts in the S6 script. |
Because of this: nginx only starts after frigate is up I think. |
that's fine, I still think it should be done in the nginx s6 script and not in the frigate code. Same as how go2rtc reads from the frigate config and defines its own config to use |
Can a new config be added like |
Or just nginx with the same options as the other logs and anything higher than info disables the access log. |
We can use something like |
I don't think python should be used for that, there is already a good example in frigate itself frigate/docker/rootfs/etc/s6-overlay/s6-rc.d/frigate/run Lines 12 to 43 in 9e531b0
|
Nice to have |
There is a nuance here: the wrong configuration when starting nginx will not allow it to start, but if it is changed after launch, it simply will not be applied, but the services will continue to work And I want to note that changing the configuration without restarting was one of the main features of nginx from the beginning of the nginx project |
I still think this is a very simple change to the file which can be done before starting nginx as frigate process itself does not need to worry about managing the other processes (which is the job of S6). In any case, the current implementation here still lacks the ability for the user to view a unified log of both access and error logs at the same time if it was enabled that way. Currently you can only have access logs or error logs. I think a much simpler solution would be to leave both access_log and error_log printing to stdout and simply comment out the access log file in the case that access logs are disabled by the user |
In this case, we need to decide who should be the general manager of all logs in the project. It's necessary to put the logs of all processes in one place, and take them from this place with corresponding filters/settings |
If I understand you correctly then I disagree with that last part. Each service (nginx, go2rtc, frigate) has its own configurations for logs and controls the filtering / behavior of what logs are output on its own. Once these logs are output to stdout S6 manages the logs and keeps them in SHM. This doesn't need to be so complicated, S6 script that starts nginx can read the frigate config and adjust its own behavior accordingly just like scripts that start frigate and go2rtc do already. That way it fits in with the current architecture. |
Did this get implemented? Id also like to disable the access logs from my docker container if possible. |
/stats and /version were removed from the access logs. There is no official way to disable all access logs |
resolve #6828