Thank you very much @dproffer@CentralCommand@rct for all your inputs, suggestions and comments. Great to read all your insights about behind the scenes of syslog in general and Home Assistant in particular. As previously mentioned I run a SynologY NAS VMM based Home Assistant Supervised, so I was searching for a ready to install add-on.
But reading your posts, things are not as simple as I’ve imagined. Is it possible for me to use the Docker logging driver to pull all logs from within my VMM Home Assistant: Core / Supervisor / Host / InfluxDB / Grafana etc?
@dproffer Thanks for providing the link to the Docker Documentation.
You’re welcome to try other ones obviously. But definitely not supported to do so and may cause supervisor to crash and not start again. Be prepared to get out of that, can’t just restore a backup in that situation.
TIL you can tell HA to fire an event for every logged message. Which I guess makes this WTH a lot easiser since you can send the details of those events wherever you want via an automation.
How big is your DB though? There’s an events table in the DB and every event is logged there. Seems like having each logged message also create a row in the DB would cause it to grow quite rapidly. Or do you exclude this event type in recorder?
It’s not actually firing an event per log entry, its firing an event per error/warning added to the bit at the top. This makes more sense. Probably still a lot to shove into your DB but not nearly as bad as actually duplicating every log entry in there.
That being said, while useful I’m not sure this answers the WTH. The real log often contains more info as well as contextual information from the surrounding logs, particular if you set default level to info. Plus you can change the level of individual components to debug things whereas no matter what you do only warnings and errors show up in the system log bit.
Yes, great elaboration about the log-files and system log, the “full logs” is what I see for e.g. all my devices in my networks. The ability to collect them on one server is very convenient and helpful debugging issues for me narrowing down towards the root of cause as much as possible.
Just started with HA(Supervised) 2 weeks ago, so slowly learning the YAML coding and careful moving forward. To be continued…
Similar to @m4v3r1ck I use the built in syslog server in Synology and find it very useful.
It is very easy to create your own syslog server on any machine you have and experiment with collecting and processing log data. It is usually straight forward and easy to change the target IP address of the syslog server in the device/software that you are wanting to get logs from. Again, making it easy to test/debug things on the fly. Below are two easy to setup syslog servers, python and go. There are many others.
However, I don’t think I’ve learned anything that solves the case where you are running Home Assistant OS on physical hardware and you want to collect kernel/driver messages so you can catch hardware or OS errors.
Yes, you can look at the supervisor logs if the Home Assistant installation is still up/functional.
Thanks @rct for your reply and insight, appreciated.
For me personally, it is a more investigative WTH question to why is it missing / what is needed / is it even possible? / to create a log to remote syslog server on a Home Assistant instance.
For sure I agree with you that it needs to have more - like you mentioned to catch hardware or OS errors. - than only copy logfile from a running Home Assistant installation, although having this possibility to be able for all logs and to collect them in my SynologY syslog server would be great.
I’m in no way code savy (on any platform) so I depend on developers for this.
It is a pretty simple syslog forwarder add-on. There’s a bit of python that reads from journald and sends to syslog, so a very minimal footprint. Note that this is for system logs (the stuff from the kernel and its drivers, daemons like docker, etc.). So good for catching hardware/OS related stuff.
Thanks for mentioning this
But just one correction - it is not only “system” stuff, it is everything what’s logging on HAOS, so also homeassistant-core and other installed AddOns