You shouldn’t be shutting it down, OH is designed to run 24/7.
Either way, logging has nothing to do with neither restarts nor runtime in the first place
(well unless you happen to use some ramdisk mechanism like zram for logs.
You didn’t tell us, though.)
Log storage/rotation is not time based so making it 30 days isn’t really possible but you can edit log4j2.xml to define the size and number of logs to store, see
This is a demo hardware running openhab in one light showroom. The owner tend to switch off everything while closing the showroom. The log need not be time limited to 30 days. 30 days is just an example.
Because it is not retained, I am not able to retrieve any information about it’s usage or any problems that he might have faced.
Today i can see one file which shows events for today and one file name openhab.log.1.gz. On extracting it, I am able to see events for yesteday.
However, beyond last restart it is flushing the data.
I want it not to flush older data.
I am not sure, which line in log4j2.xml would help me do so.
As I already said openhab doesn’t flush old logs by default.
So what you see probably happens because you do use some kind of ramdisk for the logdir and/or the box is not properly shut down.
That now obviously is not the most clever setup in combination with daily shutdowns so either of these habits you will need to change.
What’s the hardware and OS setup?