Interceptors before starting workflows and activities

Is there any interceptor called before starting any activity and workflow?
I need to initialize some MDC variables for logging purpose.

Thanks and Regards
Saket

Yes, you can use an interceptor for this.

Java interceptor configuration.

Go interceptor configuration.

Hi Maxim,
I am using cadence.I am not seeing an option for that.

Do you mind giving an example of how we can use in cadence?
Thanks for the help.

I don’t think Cadence supports interceptors.