Comments (5)
Very cool! Looking forward to that getting merged.
from scribe.
In Scribe, MDC works differently than other libraries. If you make all of your methods receive an implicit MDC then you can propagate the MDC state across multiple threads easily and it works very well with cats-effect. In the Spice web server there's a good example of this: https://github.com/outr/spice/blob/master/server/src/main/scala/spice/http/server/handler/HttpHandler.scala#L12
from scribe.
Thanks for your reply. I want to avoid using an implicit parameter because I'm developing a library which will be used for multiple business applications. Adding an extra implicit parameter in the library will put a technical implementation detail into the business logic of all applications which will use the lib. I'll keep the implicit parameter solution in mind and try to find another solution.
from scribe.
Do you have another idea in mind? I'm happy to expand the functionality of MDC if there's another route that would be better?
from scribe.
If typelevel/cats-effect#3636 gets merged I believe we can have a MDCManager
that's backed by a mdc: IOLocal[MDC]
and we leverage cats.effect.unsafe.IOLocals.get
and cats.effect.unsafe.IOLocals.set
to implement both of the following methods.
trait MDCManager {
def instance: MDC
def instance_=(mdc: MDC): Unit
}
(only works with -Dcats.effect.ioLocalPropagation=true
)
from scribe.
Related Issues (20)
- Unable to have minimumLevel=Info and only enable Trace for certain packages HOT 11
- Overriding the path for log files HOT 4
- Help: configure stdout/stderr in function of LogLevel HOT 15
- Compare perfomance with Chronicle-Logger HOT 2
- NPE when logging with SLF4J and Throwble == null HOT 4
- Different versions of scala-collection-compat pulled in transitively HOT 3
- Logger ignores `data` field HOT 3
- AsynchronousLogHandle shutdown hook HOT 3
- MDC syntax improvement HOT 7
- Standardize JSON output ? HOT 3
- Logging stderr HOT 2
- ScribeCirceJsonSupport does not output stack traces for Exceptions HOT 2
- Minimal example for JSON logging: Is this okay? HOT 2
- Allow scribe.fatal HOT 2
- FormatBlock.Date.ISO8601 does not take offset into account HOT 12
- `scribe-slf4j` does not support `slf4j-api` 2.x and `scribe-slf4j18` does not exist HOT 4
- How to integrate with scala-play HOT 3
- Error on cross linking with scala 2.12.19
- Bump scala-collection-compat dependency to 2.12.0 (fix Scala Native 0.5 support) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scribe.