User Data, Logs, and Path

Hello.
I am JUST getting my feet wet with OH2. I figured out how to change the port, as I am using MisterHouse on 8080.

But… I am running a Raspberry PI 2 from SD Card. My MisterHouse is setup to use a mounted USB flash drive for log storage and user code so it doesn’t write constantly to the sd card.

Now my question…can do the same with OH2? Can I set paths to my code and log locations?

Craig

Dear Craig,

If you are using oh 1, there is a variable in logback that allows you to change the log directory. For oh 2 I know is different, but I did not look in to it! You could try looking in to karat logging cli “log:”!

George

Hello,
if your usb flash drive is connected to the RPi all the time, I think an interesting solution would be to just move your whole /var/log to USB. That might however be tricky if your experience with Linux is limited. https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=42957

As for openHAB: Just had a look.

/usr/share/openhab2/runtime/karaf/bin/setenv:

-Dopenhab.logdir=${OPENHAB_LOGDIR}

And OPENHAB_LOGDIR can be set in /usr/share/openhab2/runtime/karaf/bin/oh2_dir_layout