4 ms·
It's single threaded. You can usually stick the context in the request object itself.
by atoko 8y ago
It's single threaded. You can usually stick the context in the request object itself.
- thom_nic 8y agoThe issue becomes when you're calling some generic library that's unaware that it is running in a request handler. If you want to log from deeper in some logic, maybe you've passed some data or domain objects but not a request/context/session object. Do you pollute that logic with additional data passed in or does your library just create its own logger and call `log.info('intermediate result of some thing: XXX')` and let the CLS magic associate that with the request that generated the call?
- andrewingram 8y agoAnd generally speaking, you want to exit the domain of request/response as early as you can, because it's your interface with the outside world, rather than something that should be pervasive throughout your system.