Thanks for the grep idea… I knew about it, but I didn’t think of it. log:display | grep -v... works, but log:tail | grep -v ... does not… Weird…
But even if it works, looks kinda tedious to enter the command every time I’m watching the console.
I tried setting the console logger with the RegexFilter, but it’s not working - Console appender not used by default (see log4j2.rootLogger.appenderRefs)
# Appenders configuration
# Console appender not used by default (see log4j2.rootLogger.appenderRefs)
log4j2.appender.console.type = Console
log4j2.appender.console.name = STDOUT
log4j2.appender.console.layout.type = PatternLayout
log4j2.appender.console.layout.pattern = %d{HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.console.filter.ignore.type = RegexFilter
log4j2.appender.console.filter.ignore.regex = .*(NAS|SystemStatus).*
log4j2.appender.console.filter.ignore.onMatch = DENY
log4j2.appender.console.filter.ignore.onMisMatch = ACCEPT
OpenHAB - Filtering event logs shows for events.log but could be adapted to openhab.log. oops, that’s this thread. I guess I can’t help except to point out alternatives.
Log4j2 Sample Config shows how to shunt all the logs from a certain binding or part of oh to a separate file.
I thought I had a fix by using NEUTRAL instead of ACCEPT for the first filter, which seemed to work initially but that didn’t work out either. So back to using Marvin_Autonomous’ solution.
I think I managed to figure something out. I could not get the filtering approach to work to filter out some recurring warning messages in the openhab log. I tried setting the root logger to ERROR and it took care of it. Not ideal but will avoid flooding my logs for now.
In the file: /srv/openhab2-userdata/etc/org.ops4j.pax.logging.cfg
There is a section for each log file
Modify the section for openhab.log the same way as the examples above
Yes this works thanks for your help! I’m still not too clear on the regex pattern matching - I can’t find a good site that explains exactly how it works with wildcards but for now this is fine.