core
core copied to clipboard
Logger async hooks
🪤 Context
Want to create workflows where all logs that get emitted all have a common property added to the logs. For example:
- incoming http request
- provide
requestIdto logger - .... business logic
- all logs that get emitted during 3 automatically have
requestIdattached, even if the log command didn't provide
🩻 Additional details
This should be a standard flow, not focusing on just http use cases
- use
AsyncLocalStorage