Open mechanarchy opened 1 year ago
Hi @greenpau , are you able to provide any insight here?
@mechanarchy , I donβt know the best way to handle this. Never used skip_logs directive.
@mechanarchy , perhaps it is a good feature to implement.
All logging that happens in the plugin are done via zap.Logger
. There is probably a way to intercept a log message, match conditions and drop it.
the directive for this might look something like this.
security {
logging skip partial msg "auth provider returned error"
}
or skips of any of them match.
security {
logging skip partial msg "auth provider returned error"
logging skip partial error "reason: no token found"
}
or skips if both are the match
security {
logging skip {
partial msg "auth provider returned error"
partial error "reason: no token found"
}
}
@greenpau Thanks for your time looking into this. The caddy skip_log
directive only works on matchers, which after further thought, is unlikely to cooperate with these unbounded/matcher-less auth logs.
Something like your suggestion here would be very helpful! I don't anticipate this would be high on your priority list, and I'm not familiar with Go to attempt a PR myself, so for the meantime I will continue to just ignore the additional logging, or filter it out (grep -v
) where required.
My Caddy logs are filled with the following errors:
and
Combined, these two messages make up 68% of my Caddy log:
I presume this is because I am not persisting the token encryption keys in my install, and a Caddy restart changes the encryption key but the client cache sessions are not updated.
Is there any way I can suppress these noisy log messages? Caddy has the
skip_log
directive, but I'm not sure of the matcher to use for Caddy Security.