in klogging when multiple loggerbases match then ...
# kotlin-logging
n
in klogging when multiple loggerbases match then having the more specifc one limited to a higher logging level has no effect..
Copy code
logging {
    fromLoggerBase("dev.kord.rest")
    fromMinLevel(Level.ERROR) {
        applySinks()
    }
}
logging {
    fromLoggerBase("dev.kord")
    fromMinLevel(Level.DEBUG) {
        applySinks()
    }
}
in something like this.. can i make sure that
dev.kord.rest.*
(which comes from slf4j) only logs error level .. but everything else is on DEBUG ?
m
Hi @Nikky I will look at how to implement that.
n
i would be nice to be able to set
consumeAll = true
and that would mean log events matched by that entry would not continue to below that
m
I have a failing test for this case (not pushed yet) and will work on it over the next few days. I am very busy with paid work so it will be sporadic. I have added an issue to describe the situation: https://github.com/klogging/klogging/issues/58
@Nikky I have implemented the changes in issue 58. Let me know if it does what you need. It is in the latest snapshot build.
n
i will be trying it out asap
seems to work so far , but i am still facing one issue there is this logger
[R]:[KTOR]:[ExclusionRequestRateLimiter]
that a library adds.. no idea what generates the name.. but even
exactLogger("[R]:[KTOR]:[ExclusionRequestRateLimiter]", stopOnMatch = true)
does not seem to catch it
Seq also shows that that is the logger name..

https://nikky.catgirl.host/i/kqnzp1a4.png

m
I think the problem is that the logger name contains characters that are special to regular expressions. The code is in
LoggingConfig.kt
. I will fix it when I can. See https://github.com/klogging/klogging/issues/60
n
quoting the logger name with
\Q
and
\E
seems to work
m
That shouldn’t be necessary. I have fixed the matching to not use regular expressions.