Took your advice and split it out into it’s own post. Since I had such a hard time finding the information originally (and after updating with OH2.2 replacing the config file) I don’t doubt you’re right it’s something a lot of people ask for.
It’s pretty straightforward as configuration goes, and hopefully adding the filtering reference to the topic name should help people find it readily enough.
Side hint: If you change you logging conf and the change does not seem to work, check if the lines you changed have trailing whitespaces ! It took me several hours to figure that out - so I like to save that time to you …
Unfortunately official documentation is for the xml file which was discontinued with OH2.
I am not sure why and nobody answered me. Maybe beacuse things would be too easy, then!
The log4j config file is identical when running on all platforms. One does not need to do anything special to make logging work when running on Windows as a service.
I totally broke all openhab logging after I edited the org.ops4j.pax.logging.cfg file. Now nothing is logging at all. I replaced the text of the file with what I found in the org.ops4j.pax.logging.cfg.dpkg-old file but no luck.
I’ve restarted it several times, used the openhabian config tool to install openhabian 2.2 (I believe I was running 2.3 snapshot) because I was under the impression that would reset everything in /var/lib/openhab2 and there for fix it but still no luck.
How do I clear the openhab.log file (not the console log which is explained in the documentation)?
Mine got to 15MB in size during the last install.
Thanks.
But what I was hoping to get across without saying it is:
15 MB is nothing to worry about
OH will move the file to openhab.log.1 when the file reaches 16 MB on its own and after it reaches the 9 it will automatically delete the old log files
in short, you shouldn’t be worrying about your log files, particularly if you do not have enough experience to be asking these questions in the first place.
But conversely there are a hell of a lot of posts on here where people are discussing all manner of ways of reducing SD card and USB drive writes to stop corruption including stopping logging all together or logging to an external file server et al.