RSyslog, offload log files to another server in HASS.io

I have been forwarding the syslog from my other RasPI boxes to a remote syslog so that I have a good history and can spot trends should problems arise. I also send my Ubuntu boxes and my tas-ma-tized devices syslog to the same server.

This offloads this usually giant log to somewhere else preventing wear on my sdcards and saves space for other things.

An add-on that would handle this in HASS.io would be awesome.

I believe there is a facility to send your homeassistant log to the syslog, I saw it in there somewhere. Combining these 2 would push all the logs to a spinning device and get them off of the PI completely.

I believe several people have asked for that to happen, this may be the easiest way.

+1

I use elasticsearch as a central syslog server and also for the hass events (thanks to https://github.com/legrego/homeassistant-elasticsearch). That is a great solution for having all the history searchable in one place. All but sadly not the syslog of hass.io.

I am seriously considering dropping hass.io and going back so I can use the rsylog…
also considering getting a mint box or something and getting out of the pi business altogether. Seems a waste to run a desktop for ha, but the pi is too slow. I thought a mint box would be about perfect.

I was hoping for more votes…
For those that know what this is, it is a fantastic idea. I suppose that most of the people that know what this is are on hasspian and don’t care if this exists or not.

Anyway, this is just a shameless plug for more votes and comments or discussion, so what do you think?
Don’t you think it would be awesome to go to a machine, in this case the one that is running my mqtt and soon my plex anyway, and see a list of all the syslogs including my sonoffs and someday to include my HASS.io instance? Each folder has the syslog of that named host to search and do wonderful things with…

[email protected]:/var/log# ls -la
total 148
drwxrwxr-x 18 root   syslog  4096 Jan 11 06:13 .
drwxr-xr-x 16 root   root    4096 May 19  2018 ..
drwx------  2 syslog syslog  4096 Dec 21 23:58 192.168.57.1
-rw-r--r--  1 root   root     488 Jan  9 10:51 alternatives.log
-rw-r-----  1 root   adm        0 Jan  4 00:06 apport.log
-rw-r-----  1 root   adm      453 Jan  3 21:56 apport.log.1
-rw-r-----  1 root   adm      356 Jan  2 23:11 apport.log.2.gz
-rw-r-----  1 root   adm      275 Dec 25 01:52 apport.log.3.gz
drwxr-xr-x  2 root   root    4096 Jan 12 11:23 apt
-rw-rw----  1 root   utmp       0 Jan 11 06:13 btmp
drwx------  2 syslog syslog  4096 Jan  3 23:32 Dishwasher
-rw-r--r--  1 root   root   56502 Jan 12 11:24 dpkg.log
drwx------  2 syslog syslog  4096 Jan  3 23:06 Dust_Collector
drwx------  3 syslog syslog  4096 Dec 28 15:58 furnacepi
drwx------ 15 syslog syslog  4096 Dec 25 01:55 garrote
drwx------  2 syslog syslog  4096 Jan  7 03:33 _gateway
drwx------  2 syslog syslog  4096 Dec 30 14:38 HUDU
drwx------  2 syslog syslog  4096 Jan 12 00:02 jensfan
-rw-rw-r--  1 root   utmp       0 Jan 11 06:13 lastlog
drwx------  2 syslog syslog  4096 Dec 24 21:54 Moms_Chair_SonoffS1
drwx------  2 syslog syslog  4096 Jan  6 20:24 raspberrypi
drwx------  2 syslog syslog  4096 Jan  3 23:28 RF_Bridge
drwx------  2 syslog syslog  4096 Jan  5 01:06 router.asus.com
drwx------  3 syslog syslog  4096 Jan 11 04:03 therani.mountcadon
drwxr-xr-x  2 root   root    4096 Jan  3 00:09 unattended-upgrades
-rw-rw-r--  1 root   utmp       0 Jan 11 06:13 wtmp
[email protected]:/var/log#

I decided to bail on this and load up a little atom processor netbook with Hasspian. I loaded Mint Mate Tessa (19) and was about to go when I found that Frenck came up with scripts to load HASS.io in a docker container.

Hey Frenck, You Rock!

Boom, I have access to the OS and rsyslog, HASS.io is still there with all the cool admin stuff I’m used to and all is well. No more rasp-PI and relying on what I think is something a bit over the head of this poor little PI and it’s sdcard harddrive.

I also found that although the little netbook works, it is a bit slower than the PI. Close bit probably 15% slower. Soo, next to that old gaming machine I have sleeping in the basement,

I’m in the same boat and was hoping for more votes on this topic. I voted months ago hoping that this suggestion would gain more traction. I know there is a sentry.io integration that was released a few months back, but the free plan reaches its limit pretty soon, especially when you are experimenting with stuff. Having some way to forward logs to a log management server locally would be tremendously useful!

I wish there was some way to enable log forwarding on HassOS. I kinda regret moving from Hassio Docker to HassOS now, looking at these restrictions.

@frenck, @pvizeli,
I apologize if directly tagging you’ll is not a good approach considering the number of notifications you may receive in a day.
I was just hoping to get some suggestions on whether there is anything we can do individually to have HassOS forward logs, even if there is no official add-on to do this?

1 Like

Please go add your thoughts to this ticket https://github.com/home-assistant/supervisor/issues/1783

My suggestion of supporting syslog was shot down ridiculously quickly without a second thought but maybe some additional comments would help revive it.

1 Like

This would be a great feature. I have it running on a raspberry pi and would love to store the logs on the Synology Log Center instead of filling up the SD card.

1 Like

Another vote for the ability to send logs via syslog. I can send logs from every other service except HassIO.

1 Like

+1

I use Graylog for all my instances and physical devices. The only device missing is HassIO :frowning:

I’m on the same boat.
I also have graylog and I will love to have my home-assistant logs into it.
Specially because there are many addons that crash and it’s very hard to debug them with the access to logs that HA provides.

Anyone found a solution to forwarding the logs on Home Assistant OS?

Anyone running rsyslog or something in a container mounting the host’s log files?

I’m currently running the “supervised” install. Not having access to the hardware logs is one of the things keeping me from going over to the Home Assistant OS install.

I am running a docker container that has access to the docker socket. Then it forwards all logs that can read from it (meaning, all home assistant integrations) to my graylog instance. I was not getting the home-assistant logs (or I think I was not getting them) so I setup a second container with the home assistant log mapped on a volume so I can send those too. I think now I am getting only logs from one of them, not sure how they compete to be honest, but at least I have the logs on a centralised place.

@danielo515 - thanks for the info. Can you see any kernel/hardware related messages? (The sort of stuff that is tagged kernel and usually winds up in /var/log/messages or /var/log/syslog)

I’d like to be able to catch those and alert on those.