On 2.7.2021 13.57, Claudio Ramirez wrote:

I want to limit the debug logging in an Authby SQL block even when the global Trace is set to 4. I wonder if this is possible.

You can limit different <Log...> clauses with Trace parameter so that a certain logger does not log, for example, anything but INFO and higher priority. Limiting a <Clause...> so that it does not emit DEBUG messages is not possible.

What you could consider is to configure LogFILE or LogSYSLOG with LogFormatHook that returns a sanitised message.

For example:
# See global LogFile documentation for details
# about default logger, etc.
# Turn of default logger
Trace 3
<Log FILE>
   Trace 4
   LogFormatHook file:"%D/log-filter.pl"
   Filename %L/filtered.log
</Log>

# %D/log-filter.pl
sub {
    my ($priority, $s, $p, $trace_id) = @_;

    # Convert numeric value to textual
    $priority = $Radius::Log::priorityToString[$priority];

    if ($s =~ m/^Query to .*AES/s) {
        # filter $s
    }

    return localtime() . ": $priority: $s";
}

--
Heikki Vatiainen <[email protected]>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, TACACS+, PAM, Active Directory,
EAP, TLS, TTLS, PEAP, WiMAX, RSA, Vasco, Yubikey, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, etc.
_______________________________________________
radiator mailing list
[email protected]
https://lists.open.com.au/mailman/listinfo/radiator

Reply via email to