Where to find the OpenHAB logs?

I installed OpenHAB (latest snapshot) on a Raspberry Pi 3 and now I’m looking for the logs as explained here:

However, they are not in /var/log/openhab2 (path doesn’t exist). Does anyone know where my logs are?

‘sudo find / -name openhab.log’ gives me no results.

Not sure what distro your using. Have you tried Karaf?

ssh -p 8101 openhab@localhost

Then you can tail the logs.


Depends how you installed OpenHab:
if you installed manually, they are here:

I installed manually, but /opt/openhab2 does not exist! /opt does though.

Yes although I did that using

 openhab-cli console

and then the log:tail command, which works fine.

But I still would like to know where my logs actually are.

Where can I see the configuration string where they are put??? The startup command (seen in htop) is

/usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.log

Now both /var/lib/openhab2 and /usr/share/openhab2 exist, but they don’t list an openhab.log file, nor anything else that could be a log. Trying to find it gives me zero results:

sudo find / -name openhab.log
sudo find / -name *openhab.log

In fact, running

 sudo find / -name *openhab*

only gives me this:


Could it be my logs only live in memory somewhere? Or is that not possible? Doing ls /tmp only gives me

getvolume  hsperfdata_openhab  hsperfdata_volumio  log  presentation.html  setvolume  shairport-sync-metadata  snapfifo  upmpdcli.conf  upmpdclicache

neither of which are OpenHAB logs.

Maybe a dirty but working way:
Install frontail via openhabian-config on the SSH session.
Afterwards, navigate in your browser to


(The dashboard on port 8001 should also give you access to frontail directly).

This easily should show you the following:

So it will list the sources for the logs.

If you don’t see those files or loggins still is not working can be the reason for old config files.
Always make sure that you replace the config files with the new ones when you are performing an upgrade.
I had also a broking logging after upgrading from 2.1 to 2.2 since the default bash answer for “new config files” is “n” which means: “Keep the old stuff”.

Good idea, but I installed manually, so I don’t have openhabian-config.

Indeed, I think something is broken. If nobody else has ideas on what to try I guess I will just have to reinstall the whole system…

Are you actually sure that OH2 is running?
systemctl status openhab2.service

Did you install the correct Java version?

I believe it is possible, but would not happen by itself; if you achieved this, you would have put enough work into it, to know where your logfiles are

Yes, it is running, I am actually able to view the log using the console with the command log:tail. I didn’t look at the code so I don’t know what happens to log messages. I think I would need a developer to tell me if it is possible that the logs just are not written to disk, but only kept in memory. (I am thinking for example a permissions issue with the file system and that the logs are not written because of that.)

Any ideas still welcome.

Since the previous search I reinstalled the system (on a Raspberry Pi) but I still cannot find my log file. There is no openhab.log anywhere in the file system on disk, nor is it in memory (/tmp). Can it only reside in /opt/openhab2/userdata/logs/openhab.log?

Actually, I read in the manual that it should be in /var/log/. Not sure why someone said it should be in /opt/openhab2/userdata/logs/. Anyway, it’s not there either.

I do have the file /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg. In there it makes reference to a variable ${openhab.logdir} but since I am unfamiliar with the source I have no idea what this value expands to.

Can a developer tell me perhaps where the logs are kept? Or how I might possibly find them?

Is there a chance or trick to use a Linux grep of the (data) log file: /var/log/openhab2/openhab.log ?
(same as possible with the events.log)

I can tail the openhab.log with:

ssh -p 8101 openhab@localhost

but how can I use “grep” to find special values or string from shell ?

Can I export the log into a regulaty textfile so I use grep on this file than ?

just use

log:tail | grep -i yourstring

in the karaf-console. To export you can use “cat”. I think you can use these commands in the ssh too.


[16:33:12] hab@openHABianPi:~$ cat /var/log/openhab2/openhab.log | grep -i float
2019-07-08 16:04:17.994 [INFO ] [se.smarthome.model.script.RainVolume] - RainVolume as Float for comparison: localHourlyForecast3RainVolume (Type=NumberItem, State=0.0 mm, Label=in 03 Stunden Niederschlagsmenge, Category=rain, Groups=[gOWM])
[16:34:08] hab@openHABianPi:~$

Strange …
I see, regulary cat and grep works (now) also from the shell …
Before the message was, that the file is a data file and can’t be displayed (cat, tail, …)
Don’t know what happens before …

But file type from openhab.log ist still “data” (events.log is “Unicode-Text”)
(saw with: file )

Sorry for late reply.
Is the file-type a problem ?

[12:07:28] hab@openHABianPi:~$ file test_test
test_test: UTF-8 Unicode text
[12:07:39] hab@openHABianPi:~$ file /var/log/openhab2/openhab.log
/var/log/openhab2/openhab.log: ASCII text

I made the following:

 tail -100 /var/log/openhab2/openhab.log > test_test

to get some lines from the log-file and bring the output to another file ( in may case it’s “test_test” in my home-directory). And the result of the file-command you can see above.

  1. Go with your Editor to your home-directory and open it