Is your feature request related to a problem? Please describe.
Moleculer offers a way to have static tags, but for a context-bound tag nothing is possible.
Currently, to track user logs with Datadog, we inject the request context (current connected user email, request ID) in the arguments of logged lines behind a wrapper that we have created:
Describe alternatives you've considered
Logging the context directly in the message is a workaround, but having it as a tag would be much easier and remove the noise of some messages that are not related.
Is your feature request related to a problem? Please describe. Moleculer offers a way to have static tags, but for a context-bound tag nothing is possible. Currently, to track user logs with Datadog, we inject the request context (current connected user email, request ID) in the arguments of logged lines behind a wrapper that we have created:
Describe the solution you'd like It would be nice if the Moleculer config exposes some kind of callback based on the context.
Something really close to what was done in: PR : https://github.com/moleculerjs/moleculer/pull/789 Issue: https://github.com/moleculerjs/moleculer/issues/784
Describe alternatives you've considered Logging the context directly in the message is a workaround, but having it as a tag would be much easier and remove the noise of some messages that are not related.