log4cats icon indicating copy to clipboard operation
log4cats copied to clipboard

Way to copy a logger's context onto a logger with a different name

Open timbertson opened this issue 7 months ago • 1 comments

I have two loggers, let's say they're named rpc and eval.

I want to handoff processing from the rpc to eval module, but my rpc logger has request info in its context, which I want to include when I make logging calls from the eval logger.

#238 is one solution, I could copy my rpc logger and also name it eval. Alternatively, if there was a way to extract the context from a logger I could either pass that around detached from the original logger, or write a function which adopted the context from a passed-in logger.

timbertson avatar Jul 06 '24 01:07 timbertson