-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Logs in UI #4562
Logs in UI #4562
Conversation
✅ Deploy Preview for frigate-docs canceled.
|
@felipecrs I saw you commenting on just-containers/s6-overlay#252 and it seems you'll likely have a better understanding of this than I do. We need to log python, go2rtc, and nginx (and future services) to a file in memory (want to avoid writing logs to disk). It seems s6 is the best way to do this. This log file in memory can then be read to show the logs in the UI, if you have any ideas I'd be happy to hear them |
I have to tinker with it a bit. I'll be back in a few hours with some snippets for you. :) |
I appreciate it |
I think it's finally time to upgrade to s6 v3... Logging is simpler with it. I'll push a PR. |
Will be rebased on dev once #4587 is merged |
I wonder if we should omit nginx and go2rtc logs from the container stdout now that we have this feature. I believe it may turn the add-on logs page very confusing with everything combined. I also thought about prefixing the logs on stdout with the service name, but I'm not sure how exactly we can do that (just-containers/s6-overlay#447 (comment)). |
That's a question for @blakeblackshear I don't really have an opinion one way or the other. |
Well, actually it doesn't matter much. With the new UI users won't have to look at the container logs. Only if they want. |
right, I think that's the goal. Just need to make sure there are no downsides to the UI logs |
One future improvement I can think about is colorizing. :) |
I'm seeing the color characters for go2rtc just haven't had time to look into how html can be set to change them to colors. If you know the answer I'm all ears |
On a quick search I found this: https://www.npmjs.com/package/ansi-to-html |
It would be really nice if https://github.com/emilast/vscode-logfile-highlighter could be reused outside of VS Code. It can colorize the logs automatically. |
Oh, there's one thing to have in mind that I only realized now: Since #4587 the log files are written to memory (/dev/shm). Docker by default allocates 64MB for each container, but that can be increased per container with a CLI flag. Unfortunately, HA doesn't support configuring the shm size.
So, with the current logic, the log files can take up to 60MB. Is anything else writing data to |
That's not quite true, the shm size can be increased for HA addons it just has to be set as one value for all addons. (edit: or maybe that was only for /tmp/cache, I can't remember) And yes, we have the camera frames for detect stored in /dev/shm so that may be a concern for addon users. |
I don't think we need to keep log archives beyond 10MB. Containers aren't really supposed to retain state like that, and we probably don't ever want to mess with trying to read those archives for the UI either. These files are essentially an in memory buffer for the UI to read logs. If users want a longer history of logs, they should do that by capturing the container logs and storing them on the host. Frigate also has fairly quiet logs normally. Even with 10MB, I suspect we will get support issues with "Bus error" crashes. |
Here is a demo of the new logs page
Screen.Recording.2022-12-05.at.11.38.35.AM.mov