Suppress timeout messages

Hi,
I use the http binding to request data from a local device which most time is offline. So, the data is only updated infrequently (which is ok). However, each time the binding is connecting to the device and the device is turned off, I receive a timeout warning in the log

>  Requesting 'http://192.168.10.64/general/information.html?kind=item' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed

I know that the warning is on purpose and makes sense. But I would like to get rid of it since it only occupies my log. How can I do that?

Thank you!

If it is a warning you should be able to set the log level to error and warnings will be supressed.

I did so, this works. But then any warning messages regarding the associated binding are gone. I assume that ‘somehow’ it is possible to change the log level to exactly the message I provided, but I have no clue how. I assume on the karaf level basis this is not possible (log:set error [name of binding according to list -s] only considers the whole binding, not the individual error message.

Set up a regex filter in your log4j2.xml file.

An other example

Tried to do so, editing log4j2.xml under Rolling file appender:

<RegexFilter regex=".*(10\.64).*" onMatch="DENY" onMismatch="NEUTRAL"/>

Still, the log shows the entries as mentioned above:

2024-03-01 11:53:59.045 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.10.64/general/information.html?kind=item' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed

Any suggestion? I think the Regex is correct according to https://regex101.com/

check the advanced doc of the binding, it includes a section for setting up the logging

That is of no big help. As you can read from above, I already tried to do what seems reasonable. However, it does not work.