My first steps with OpenHab

After beating my head against the wall for about an hour, I managed to filter out some garbage from openhab.log using this super-useful thread: openHAB - Filtering event logs. This is my filter:

log4j2.appender.out.filter.stuff.type = Filters

log4j2.appender.out.filter.stuff.Modbus1stConnectionRefused.type = RegexFilter
log4j2.appender.out.filter.stuff.Modbus1stConnectionRefused.regex = .*connect try 1/3 error.*
log4j2.appender.out.filter.stuff.Modbus1stConnectionRefused.onMatch = DENY
log4j2.appender.out.filter.stuff.Modbus1stConnectionRefused.onMismatch = NEUTRAL

Until I did it this way - which is intended to allow for multiple expressions to be added in sequence - I couldn’t get the filter to work. Doing it the other way:

log4j2.appender.out.filter.Modbus1stConnectionRefused.type = RegexFilter
log4j2.appender.out.filter.Modbus1stConnectionRefused.regex = .*connect try 1/3 error.*
log4j2.appender.out.filter.Modbus1stConnectionRefused.onMatch = DENY
log4j2.appender.out.filter.Modbus1stConnectionRefused.onMismatch = NEUTRAL

resulted in nothing appearing in the log at all.

I note Rich’s comment about filtering, but I continuously get this line in the log:

2020-06-12 02:07:29.649 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: Connection refused (Connection refused). Connection TCPMasterConnection@128737e[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@1c0cb5b[address=192.168.0.100,port=502]

and it’s 95% of the content.
Now I can move on to more productive things.