[slf4j-dev] Proposal for SLF4J 2.0 Logger API

Toolforger toolforger at durchholz.org
Tue Dec 17 22:18:23 CET 2019


Am 17.12.19 um 20:41 schrieb Gary Gregory:
> One downside to logging Objects is that the logging library needs to 
> watch out for recursion. IOW, invoking an object's toString() may end up 
> doing some logging itself.
Is that a different scenario than what will happen during
   LOGGER.info("Sending packet: {}", packet);
?

I can imagine similar scenarios for custom Appenders and all the other 
objects; these may even have serious reason to log stuff (e.g. to 
diagnose issues in their own machinery).

The way out would be to just save such logging requests while a log 
request is being processed.
I dimly recall having seen just that, though I don't recall details and 
may have misassociated the code.

Regards,
Jo


More information about the slf4j-dev mailing list