typelevel / typelevel/log4cats
Way to copy a logger's context onto a logger with a different name
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 416
- Forks
- 77
- Avg merge
- 6h 25m
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing logger and context APIs, then review issue #238 for the related copy-and-rename approach. Determine how context could be extracted or adopted while changing the logger name; done means a documented, tested way to preserve request context when handing off from rpc to eval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100