-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Connection Pool: how to filter debug logging? #1013
Comments
These are log messages for the connection pool. We have both a We should make sure the |
This is extremely annoying, bloating logs with no easy way to filter them out. Please provide a workaround or a logback config how to filter these away ASAP. |
If you want a thing to be done "ASAP" you can provide a pull request or get commercial support. Thanks in advance. |
I agree with @ochrons on this one. I messed up that logging. I thought that at least the The way it is now, you cannot use the Akka Http 10.0.5 client because you have to completely disable DEBUG logging for your application otherwise you will drown in those logs and cannot do much about it. |
A workaround is to define a custom The default slf4j logging filter will use whatever settings you define in your logging backend's client configuration but you could provide a custom one as well that filters out those message directly. See here for sl4j's default filter: https://github.com/akka/akka/blob/master/akka-slf4j/src/main/scala/akka/event/slf4j/Slf4jLogger.scala#L134 A custom implementation that filters out all debug messages from them pool (as witnessed by containing package xyz
import akka.event.slf4j.Logger
class CustomAkkaHttpSlf4jLoggingFilter(settings: ActorSystem.Settings, eventStream: EventStream) extends LoggingFilter {
def isErrorEnabled(logClass: Class[_], logSource: String) =
(eventStream.logLevel >= ErrorLevel) && Logger(logClass, logSource).isErrorEnabled
def isWarningEnabled(logClass: Class[_], logSource: String) =
(eventStream.logLevel >= WarningLevel) && Logger(logClass, logSource).isWarnEnabled
def isInfoEnabled(logClass: Class[_], logSource: String) =
(eventStream.logLevel >= InfoLevel) && Logger(logClass, logSource).isInfoEnabled
def isDebugEnabled(logClass: Class[_], logSource: String) =
!logSource.contains("/Pool(") &&
(eventStream.logLevel >= DebugLevel) && Logger(logClass, logSource).isDebugEnabled
} You enable it by setting
|
Got it working fine with this filter, thanks for the quick response! |
Before, the log source was the descriptive string that describes the pool but that can be hard to match on in logging backends. Now, logging backends will see "PoolGateway" as the source for all pool logging statements (still not quite the common practice but will simplify to filter on all messages relating to the client pool).
Before, the log source was the descriptive string that describes the pool but that can be hard to match on in logging backends. Now, logging backends will see "PoolGateway" as the source for all pool logging statements (still not quite the common practice but will simplify to filter on all messages relating to the client pool).
Before, the log source was the descriptive string that describes the pool but that can be hard to match on in logging backends. Now, logging backends will see "PoolGateway" as the source for all pool logging statements (still not quite the common practice but will simplify to filter on all messages relating to the client pool). Fixes akka#1013.
Before, the log source was the descriptive string that describes the pool but that can be hard to match on in logging backends. Now, logging backends will see "PoolGateway" as the source for all pool logging statements (still not quite the common practice but will simplify to filter on all messages relating to the client pool). Fixes #1013.
Before, the log source was the descriptive string that describes the pool but that can be hard to match on in logging backends. Now, logging backends will see "PoolGateway" as the source for all pool logging statements (still not quite the common practice but will simplify to filter on all messages relating to the client pool). Fixes akka#1013.
akka-http 10.0.5
logging via SLF4J (logback).
we use
<pattern>%d{ISO8601} [%-5p] %m%n</pattern>
and got in log a lot ofHow filter this from log?
First try - add
%c
, to get log event category (typicaly hold className), butbut why?
Any ideas?
The text was updated successfully, but these errors were encountered: