OpenHABian and Syslog

  • Platform information:
    • Hardware: RasPi4
    • OS: OpenHABian Release
    • Java Runtime Environment: Zulu 8
    • openHAB version: 2.5.6 Release
  • Issue of the topic:

Hi together,
I setup OpenHABian on a new Raspi4 and moved my complete OpenHAB configuration from my previous machine (Windows-PC) to there.
Now, I realised that the ZRAM-drive gets filled up after a couple of hours, as the logs are growing incredibly fast, due to many events coming in from all the measurements.
I think, that all information is logged three times in three different files (all have the same data):
/var/log/syslog
/var/log/daemon.log
/var/log/openhab2/events.log or /var/log/openhab2/openhab.log (depending on the exact item to be logged)

I disabled event-logging via the Karaf-console (log:set off smarthome.event). Is there a way to stop OpenHAB from logging the same messages into the three different log files?
I would prefer OpenHAB to only log into the files in /var/log/openhab2.

Thanks for your help!

Did you read the ZRAM thread? afaik there is no need to disable logging.

Nope, only into the last two. And it’s rotated btw.

Thank you for your answers.
Yes, I read about how ZRAM works. However, my problem was that the RAM drive got filled up within minutes, not allowing the creation of any folder or additional log file. Consequently, amanda backup did not run properly.
I still think that in my case all information is logged three times. Below you find some snippets from the tail output of the different log files.
Disabling the logging in OpenHAB worked, such that there is not much information in events.log and openhab.log, now.

Thanks!

syslog:

Jul 21 07:42:46 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:42:46: MQTT publish: topic ‘zigbee2mqtt/WindowSensor02’, payload ‘{“battery”:100,“voltage”:3005,“contact”:false,“linkquality”:81}’
Jul 21 07:42:52 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:42:52: MQTT publish: topic ‘zigbee2mqtt/WindowSensor02’, payload ‘{“battery”:100,“voltage”:3005,“contact”:true,“linkquality”:76}’
Jul 21 07:45:01 openhab CRON[17994]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 21 07:46:25 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:46:25: MQTT publish: topic ‘zigbee2mqtt/OsramPlug01’, payload ‘{“state”:“OFF”,“linkquality”:102,“update_available”:false}’
Jul 21 07:51:27 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:51:27: MQTT publish: topic ‘zigbee2mqtt/WindowSensor01’, payload ‘{“battery”:86,“voltage”:2975,“contact”:false,“linkquality”:2}’
Jul 21 07:55:01 openhab CRON[18239]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 21 07:57:22 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:57:22: MQTT publish: topic ‘zigbee2mqtt/WindowSensor03’, payload ‘{“battery”:100,“voltage”:3015,“contact”:true,“linkquality”:0}’
Jul 21 08:01:33 openhab influxd[604]: ts=2020-07-21T06:01:33.401162Z lvl=info msg=“Retention policy deletion check (start)” log_id=0O7RCNL0000 service=retention trace_id=0O7~FcrG000 op_name=retention_delete_check op_event=start
Jul 21 08:01:33 openhab influxd[604]: ts=2020-07-21T06:01:33.401450Z lvl=info msg=“Retention policy deletion check (end)” log_id=0O7RCNL0000 service=retention trace_id=0O7~FcrG000 op_name=retention_delete_check op_event=end op_elapsed=0.342ms
Jul 21 08:05:01 openhab CRON[18462]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 21 08:11:20 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 08:11:20: MQTT publish: topic ‘zigbee2mqtt/WindowSensor04’, payload ‘{“battery”:100,“voltage”:3025,“contact”:true,“linkquality”:28}’

daemon.log:
Jul 21 07:42:46 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:42:46: MQTT publish: topic 'zigbee2mqtt/WindowSensor02', payload '{"battery":100,"voltage":3005,"contact":false,"linkquality":81}'
Jul 21 07:42:52 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:42:52: MQTT publish: topic 'zigbee2mqtt/WindowSensor02', payload '{"battery":100,"voltage":3005,"contact":true,"linkquality":76}'
Jul 21 07:46:25 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:46:25: MQTT publish: topic 'zigbee2mqtt/OsramPlug01', payload '{"state":"OFF","linkquality":102,"update_available":false}'
Jul 21 07:51:27 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:51:27: MQTT publish: topic 'zigbee2mqtt/WindowSensor01', payload '{"battery":86,"voltage":2975,"contact":false,"linkquality":2}'
Jul 21 07:57:22 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 07:57:22: MQTT publish: topic 'zigbee2mqtt/WindowSensor03', payload '{"battery":100,"voltage":3015,"contact":true,"linkquality":0}'
Jul 21 08:01:33 openhab influxd[604]: ts=2020-07-21T06:01:33.401162Z lvl=info msg="Retention policy deletion check (start)" log_id=0O7RCNL0000 service=retention trace_id=0O7~FcrG000 op_name=retention_delete_check op_event=start
Jul 21 08:01:33 openhab influxd[604]: ts=2020-07-21T06:01:33.401450Z lvl=info msg="Retention policy deletion check (end)" log_id=0O7RCNL0000 service=retention trace_id=0O7~FcrG000 op_name=retention_delete_check op_event=end op_elapsed=0.342ms
Jul 21 08:11:20 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 08:11:20: MQTT publish: topic 'zigbee2mqtt/WindowSensor04', payload '{"battery":100,"voltage":3025,"contact":true,"linkquality":28}'
Jul 21 08:23:26 openhab npm[603]: #033[32mzigbee2mqtt:info #033[39m 2020-07-21 08:23:26: MQTT publish: topic 'zigbee2mqtt/WindowSensor02', payload '{"battery":100,"voltage":3005,"contact":false,"linkquality":78}'

No it is not. You yourself have created that problem: you have setup and misconfigured zigbee2mqtt.
Fix that not to log. According to your logs (btw: use code fences), zigbee2mqtt is the only program to log there, and it is not part of openHABian. The rest of openHABian is properly configured. It won’t fill default ZRAM before it’s rotated hence no need to change anything about that.

1 Like

Thank you very much for your answer(s), that helped.

Now I understand what happened:

  • zigbee2mqtt and influxdb were writing (massively) to the system logs (that are not rotated by size but by time), while
  • OpenHAB was writing similar messages to the OpenHAB log.

In order to solve the issue:

  • I disabled query-logging in influxdb (in /etc/influxdb/influxdb.conf set query-log-enabled=false) and
  • disabled logging in zigbee2mqtt (in configuration.yaml set advanced: log_level: error).

Problem solved.

I have a very similar issue. My syslog and deamon.log are full of these XMPP-streams:

Jan 21 22:56:40 HomeCenter karaf[1434]: IN (tinyxmppd1745910): <?xml version=“1.0” encoding=“UTF-8”?><project timeStamp=“562713” sessionId=“19e0a2cc” type=“update” mrhaVersion=“2.5.5” mrhaBuild=“7857”><privileges><user name="xxx@busch-jaeger.de"><privilege path=“60003C02D2” accessLevel=“3”/></user></privileges><devices><device serialNumber=“ABB700C8C0” domainAddress=“9376” state=“modified” commissioningState=“ready” progress=“100”><channels><channel state=“modified” i=“ch0000” cid=“ABB702EB”><inputs/><outputs><dataPoint state=“modified” i=“odp0001” full=“false”><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>
Jan 21 22:56:40 HomeCenter karaf[1434]:
Jan 21 22:56:41 HomeCenter karaf[1434]: IN (tinyxmppd1745910): <?xml version=“1.0” encoding=“UTF-8”?><project timeStamp=“562714” sessionId=“19e0a2cc” type=“update” mrhaVersion=“2.5.5” mrhaBuild=“7857”><privileges><user name="xxx@busch-jaeger.de"><privilege path=“60003C02D2” accessLevel=“3”/></user></privileges><devices><device serialNumber=“ABB700C811” domainAddress=“9376” state=“modified” commissioningState=“ready” progress=“100”><channels><channel state=“modified” i=“ch0000” cid=“ABB702EB”><inputs/><outputs><dataPoint state=“modified” i=“odp0001” full=“false”><value>0</value></dataPoint><dataPoint state=“modified” i=“odp0003” full=“false”><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>
Jan 21 22:56:41 HomeCenter karaf[1434]:

Can anyone give me a hint, where to turn these logs off?
Base is, that I’m using freeathome Binding. This causes the logs but I don’t know where to find the config.

Thanks and regards,
Daniel

Not a part of openHABian so you must have set that up yourself. That’s where you also can turn it off :wink:

Thanks for instant feedback …
I have to find it out anyway, how to switch it off