Tracing codec failures

Hi
I have several remote customers connected to my asterisk - v11.21 . Occasionally, the logs indicate “No compatible codecs” - but this happens way before any dialplan execution - and there is no reference to ip / account / exten / etc…
How could I trace the username / ip / etc… that causes the message ?
Rgds
J.

Enable the channel driver debug logging. If your channel technology is SIP and and you are using chan_sip, use “sip set debug on”. You also need to enable the debug category in logger.conf.

Indeed it is sip, but turning sip debug on will cause a lot of output on a production system, for an issue that arises once in a while - I was hopping to find something more targeted, that would print out only when the wrong codec is offered.