[SOLVED] Log file ring buffer

I don’t know if you can have all logs managed by systemctl. You can have all logs go to the syslog (see https://stackoverflow.com/questions/17947611/log4j2-syslog-appender-and-patternlayout) but it’s going to be a bit of work on your part and you’ll have to learn log4j2 and according to that thread there are bugs that need to be worked around. I know of no one who has attempted to do this so you will largely be on your own.

Log4j2 Sample Config shows how to move all the logging from a specific binding to it’s own log file and change the logging level of just that one binding. It should be an example to get you started. But to expand beyond that example and what’s in the docs you will have to go to the Log4j docs.

But if you want full control over the logs you will need to muck around with the log4j2 configuration anyway so you may as well just do it all there. You have full control over what get’s logged and at what level to what files and how those files are managed and rotated there.

Have you done any changes to your log configuration? By default, the logger is configured to rotate the files at 17 mb and only keeps the last 10 files to two different log files (events.log and openhab.log). So either you changed something or there is something wrong because you should never see more than 340 MB of log files from openHAB at any given time, assuming the default configuration.

1 Like