You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm trying to add some complex appenders, for example, Kafka appender, it's natural to use a Kafka client lib. However, such a client lib may log inside also, which can result in an infinite recursive logging if such an appender is installed globally.
I did some investigation and how a possible solution, but would like to open this issue for discussion:
This is a tricky topic, and one that any log framework will encounter at some point. Since log itself doesn't give you many tools to work with, one option that logforth could use is to set a thread-local at the start of its entrypoint Log::log implementation and use that to discard or re-route logs produced while that local is set. It would mean that you'd need some control over whether code plugged in to the appender created any background threads, but it limits the potential for infinite log looping.
Some
log
implementations support logger pipeline. For example, inlogforth
you can write:When I'm trying to add some complex appenders, for example, Kafka appender, it's natural to use a Kafka client lib. However, such a client lib may log inside also, which can result in an infinite recursive logging if such an appender is installed globally.
I did some investigation and how a possible solution, but would like to open this issue for discussion:
This is, however, both brittle and may filter logs from user code. I don't know how targets are defined and if we can reliably depend on that matches.
The text was updated successfully, but these errors were encountered: