/var/log/syslog spammed

Hi all,

Since a week or so I noticed that my sd-card is filling with log files. I think, but I’m not sure, its since the update to version 0.36.0 of HASS. In /var/log/syslog and /var/log/daemon.log there are a lot of HASS entries. Is it possible to change this behavior?

Here’s a directory listing of /var/log

pi@hass:/var/log $ ls -lh
total 3.1G
-rw-r--r-- 1 root     root      534 Jan 16 13:46 alternatives.log
-rw-r--r-- 1 root     root     3.2K Dec  5 11:36 alternatives.log.1
-rw-r--r-- 1 root     root     2.5K Nov 25 21:06 alternatives.log.2.gz
drwxr-xr-x 2 root     root     4.0K Jan  1 06:25 apt
-rw-r--r-- 1 root     root        0 Dec  1 06:25 aptitude
-rw-r--r-- 1 root     root     1.1K Nov 25 21:06 aptitude.1.gz
-rw-r----- 1 root     adm       15K Jan 24 16:22 auth.log
-rw-r----- 1 root     adm      8.3K Jan 22 20:28 auth.log.1
-rw-r----- 1 root     adm         0 Jan 24 16:22 auth.log.1.gz
-rw-r----- 1 root     adm       886 Jan 22 06:25 auth.log.2.gz
-rw-r----- 1 root     adm      2.7K Jan 20 10:07 auth.log.3.gz
-rw-r--r-- 1 root     root     5.2K Jan 16 13:59 boot.log
-rw-r--r-- 1 root     root      73K Sep 23 04:24 bootstrap.log
-rw------- 1 root     utmp        0 Jan  1 06:25 btmp
-rw------- 1 root     utmp        0 Dec  1 06:25 btmp.1
-rw-r----- 1 root     adm      821M Jan 24 16:22 daemon.log
-rw-r----- 1 root     adm      686M Jan 22 20:28 daemon.log.1
-rw-r----- 1 root     adm         0 Jan 24 16:22 daemon.log.1.gz
-rw-r----- 1 root     adm       29M Jan 20 10:08 daemon.log.3.gz
-rw-r----- 1 root     adm      8.3M Jan 16 06:25 daemon.log.4.gz
-rw-r----- 1 root     adm         0 Jan 17 06:25 debug
-rw-r----- 1 root     adm       990 Jan 16 13:59 debug.1
-rw-r----- 1 root     adm       357 Dec 11 13:19 debug.2.gz
-rw-r----- 1 root     adm       358 Dec  5 11:43 debug.3.gz
-rw-r----- 1 root     adm       662 Nov 25 22:11 debug.4.gz
-rw-r----- 1 root     adm        31 Sep 23 04:23 dmesg
-rw-r--r-- 1 root     root      34K Jan 16 13:46 dpkg.log
-rw-r--r-- 1 root     root      21K Dec  5 11:36 dpkg.log.1
-rw-r--r-- 1 root     root      31K Nov 25 22:02 dpkg.log.2.gz
-rw-r--r-- 1 root     root      24K Jan  4 16:05 faillog
drwxr-xr-x 2 root     root     4.0K Dec 16 14:43 foscam2mqtt
drwxr-xr-x 2 root     root     4.0K Sep 23 04:23 fsck
drwxr-xr-x 2 grafana  grafana  4.0K Jan 17 20:24 grafana
drwxr-xr-x 2 influxdb influxdb 4.0K Nov 12 01:04 influxdb
-rw-r----- 1 root     adm         0 Jan 17 06:25 kern.log
-rw-r----- 1 root     adm       29K Jan 16 13:59 kern.log.1
-rw-r----- 1 root     adm       103 Jan  1 00:59 kern.log.2.gz
-rw-r----- 1 root     adm      7.2K Dec 11 13:19 kern.log.3.gz
-rw-r----- 1 root     adm      7.2K Dec  5 11:43 kern.log.4.gz
-rw-rw-r-- 1 root     utmp     286K Jan 22 20:19 lastlog
drwx------ 2 root     root     4.0K Nov 25 21:56 letsencrypt
-rw-r----- 1 root     adm       28K Jan 24 16:22 messages
-rw-r----- 1 root     adm       80K Jan 22 20:28 messages.1
-rw-r----- 1 root     adm         0 Jan 24 16:22 messages.1.gz
-rw-r----- 1 root     adm       13K Jan 22 06:26 messages.2.gz
-rw-r----- 1 root     adm       19K Jan 20 10:08 messages.3.gz
drwxr-xr-x 2 ntp      ntp      4.0K Jul 26  2016 ntpstats
drwxr-xr-x 2 root     root     4.0K Jan 23 00:08 p1mqtt
drwxrwxr-t 2 root     postgres 4.0K Jan 22 06:25 postgresql
-rw-r--r-- 1 root     root      544 Sep 23 05:54 regen_ssh_keys.log
drwxr-x--- 2 root     adm      4.0K Jun  1  2016 samba
drwxr-xr-x 2 root     root     4.0K Jan 16 13:59 supervisor
-rw-r----- 1 root     adm      821M Jan 24 16:22 syslog
-rw-r----- 1 root     adm      686M Jan 22 20:28 syslog.1
-rw-r----- 1 root     adm      640K Jan 23 06:25 syslog.1.gz
-rw-r----- 1 root     adm      7.3M Jan 21 06:25 syslog.3.gz
-rw-r----- 1 root     adm       17K Jan 20 10:08 syslog.4.gz
-rw-r----- 1 root     adm       14M Jan 20 10:05 syslog.5.gz
-rw-r----- 1 root     adm       16M Jan 17 06:25 syslog.6.gz
-rw-r----- 1 root     adm      1.4M Jan 16 06:25 syslog.7.gz
-rw-r----- 1 root     adm       60K Jan 20 10:05 user.log.1
-rw-r----- 1 root     adm       305 Jan 16 13:59 user.log.3.gz
-rw-r----- 1 root     adm      1.2K Jan  4 21:05 user.log.4.gz
-rw-rw-r-- 1 root     utmp     6.4K Jan 22 22:37 wtmp
-rw-rw-r-- 1 root     utmp      14K Dec 26 16:28 wtmp.1

these are the last 20 lines of /var/log/syslog. It seems all mqtt messages are logged in syslog;

pi@hass:/var/log $ tail syslog -n 20
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired"

Also /var/log/daemon.log contains mqtt messages;

Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+00:00", "data": {"payload": "3407.307", "topic": "events/p1/1-0:1.8.2", "qos": 0}}
Jan 24 06:25:10 hass homebridge[5925]: [1/24/2017, 6:25:10 AM] [HomeAssistant] Received event: {"origin": "LOCAL", "event_type": "mqtt_message_received", "time_fired": "2017-01-24T05:25:10.321222+0

What can I do to solve this. Now it takes about 4 hours to fill my sd-card. The logs are rotated every night by cron (default on rasbian).

I’m running HASS 0.36.0 on a RPi3 using a 8gb sd-card. I’ve used the AIO installer.

1 Like

Joining this problem. What is the possible way to exclude this?

Hi, I have the same issue. Any workarounds?

I used rsyslog to “fix” this. I put this filter in rsyslog.conf to send all hass-related entries to a separate log file to keep /var/syslog clean:

if $programname == 'hass' then /var/log/hass.log
&stop
2 Likes

Old post, but can perhaps help people. I had the same thing too, noticed that ‘something’ was spamming my logs. In my case it was OZW logs for z-wave which was spamming because one of the devices was marked as “Probe” in zwcfg.xml file. This caused a endless loop. Removing the faulty entry and restarting fixed it for me. (Setting zwave: debug to true, also gives a major output)

And I have same problem. My log files are 20 Gb for 24 hours, You are fixing the problem after it happens, and i want to fix my problem before it happens, so it doesn’t go to syslog and daemon.log, i have also home-assistant.log , so i have 3 log files with same content… Any help with this?

Have you tried changing the log level to warning or error as described in the documentation to decrease the number of messages logged in the first place?

I am also trying to get HASS stop flooding my syslog.

To change the log level in configuration.yaml under logger: does not change anything.
The syslog is still flooded with “less important” messages.

Running HASS on Ubuntu 16.04, in virtual environment, with systemd-journald and rsyslog

What did you change your logger: section to?

Like this:

logger:
  default: warning

That looks like mine. And after doing a restart, you still get info: messages coming out, or are you being spammed by warning level messages?

Yes i did restart HASS from within the front end calling the “homeassistant.restart”.

But restarting the systemd service instead from the shell did the trick. Now my syslog is not flooded any more.

1 Like

I just noticed this behavior after a fresh install of 59.3

I too have added an entry for logger and restarted it via cmdline systemctl. Still logging EVERYTHING. The logger entry is set to:

logger:
  default: error

So what’s the deal? How do I turn off logging to syslog altogether? I have a home-assistant.log and this is redundant and causing syslog to fill up to 15M each time.

Any help here guys?

Rene’

1 Like

Nevermind. I restarted it again and reverified the logs and it’s working as expected.

slaps forehead

Rene’

I’m having this same issue. I’ve set logger to several different values and I’ve removed the logger section from my config file altogether. I’ve restarted home assistant several times and I’ve rebooted my machine and it’s still filling up the syslog with a ton of messages.

1 Like

It seems after restarting the rsyslog service the changes finally took affect.

Now I need to figure out how to keep homebridge and influxdb from spamming syslog.

For anyone trying to disable logging in homebridge, try adding “logging”: false, to the config.json file like this:

{
  "bridge": {
    "name": "Homebridge",
    "username": "",
    "port": 57127,
    "pin": ""
  },
  "description": "This is an example configuration file for Homebridge that includes the Home Assistant plugin.",
  "accessories": [
  ],
  "platforms": [
    {
      "platform": "HomeAssistant",
      "name": "HomeAssistant",
      "host": "",
      "password": "",
      "logging": false,
      "supported_types": ["automation", "binary_sensor", "climate", "cover", "device_tracker", "fan", "group", "input_boolean", "light", "lock", "media_player", "remote", "scene",     "script", "sensor", "switch", "vacuum"],
      "default_visibility": "hidden"
    }
  ]
}

I didn’t see this in the docs anywhere but it seems to work.

In my case, it seems that my syslog is filling up because systemd just logs the output to /var/log/syslog by default. I changed my config for home assistant and now I don’t have any entries in syslog anymore.

Edit the file in /etc/systemd/system/[email protected]

My config looks like this now, notice the StandardOutput and StandardError entries under service.

[Unit]
Description=Home Assistant
After=network-online.target mariadb.service zigbee2mqtt.service

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.homeassistant"
RestartForceExitStatus=100
StandardOutput=null
StandardError=file:/var/log/home-assistant.log

[Install]
WantedBy=multi-user.target

Logging to my local home-assistant.log is still working, so for investigation I can look there.