openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
822 stars 251 forks source link

Specify logging in new XML format #1575

Closed mstormi closed 3 years ago

mstormi commented 3 years ago

Once more I had logging fill the (SD) disk and came to think if we should limit that better in openHABian. (EDIT: or change OH's default ?)

We should limit the size and number of logs, and unlike OH default config, we should gzip them. Attention: we must NOT use any external tool such as logrotate for OH logs! log4j2 handles this.

Unfortunately, the config format to spec what's logged and how it's treated - specified in /var/lib/openhab/etc/log4j2.xml - has changed to xml and all the information I have (for now) is in the old format. http://karaf.apache.org/manual/latest/#_log4j_v2_support https://github.com/openhab/openhab-docs/issues/1163

For reference, stuff to change in old format:

log4j2.appender.event.strategy.type = DefaultRolloverStrategy
log4j2.appender.event.strategy.max = 7

log4j2.appender.event.strategy.fileIndex = min (not sure if that last is required)

log4j2.appender.out.filePattern = ${openhab.logdir}/openhab.log.%i.gz (to have it gzip logfiles)

ecdye commented 3 years ago

I don't see any problem with this. It may even help solve a problem which is kind of nice too.

mstormi commented 3 years ago

Fixed-By: openhab/openhab-distro#1312