Edit read only logging cfg


I installed the network bindung and use it. I also use the lastSeen item which logs a lot.

I read how to filter logs by editing /srv/openhab2-userdata/etc/org.ops4j.pax.logging.cfg
But this file is read only and I can’t edit it.

Can sameone help me?

I tried ":w !sudo tee %“ but this doesn’t help.
I always get:

“/srv/openhab2-userdata/etc/org.ops4j.pax.logging.cfg” E212: Cannot open file for writing
Press ENTER or type command to continue

It’s not read only. It’s likely you just don’t have permission to edit as your regular login user. That’s pretty standard for most configuration files like this. Try using sudo which requests to run what ever follows it as the user root who can read and write to everything.

No, I also got the same error as root:

sudo vi /srv/openhab2-userdata/etc/org.ops4j.pax.logging.cfg

But I found an other solution. I switched ItemStateChangedEvent to WARN in the openhab-cli console.

But I would prefere filter a single log message…
Like this: openHAB - Filtering event logs

That’s a very odd path and if you can’t edit it as root you are not running on a normally configured Linux machine. It’s kind of extremely important to tell us that sort of thing. What are you running o? How did you install it?

I used the sd card image.

I was now able to edit the file and added:
r.event.policies.size.size = 16MB

Filtering Rules

log4j2.appender.event.filter.networkLastSeen.type = RegexFilter
networkLastSeen.regex = .(Network_SamsungS10_LastSeen|Network_SamsungA51_LastSeen).
log4j2.appender.event.filter.networkLastSeen.onMatch = DENY
log4j2.appender.event.filter.networkLastSeen.onMisMatch = ACCEPT

Do I have to restart the System or just openhab-cli stop and start?

Just stop and start.


I restart the System because stop/start doesn’t work for me and now the folder /etc/openhab is gone…

Any ideas why?
Can i fix this?

I recreated the structure manually and restored same oder config files from Backup.
it works again…

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.