Hi,
I’m setting up my first workflow on my self hosted version of temporal. I discovered that workflows and activities both have their own Info classes with lots of contextual information.
Is there a way to configure temporal to automatically add these attributes to my logging as context?
or am I better off creating my own ContextManager for logging in each workflow sort of like:
@workflow.defn
class SomeWorkflow:
@workflow.run
async def run(self) -> None:
with WorkflowInfoLogger(workflow.info()):
logger.info('we did the thing!!!')
Ideally, it would be great to have some temporal context on all the log messages we produce, that look something like:
{
"message": "we did the thing!!!",
"run_id": "333e788c-205b-4ace-813c-a529a1d1e3e4",
"workflow_id": "333e788c-205b-4ace-813c-a529a1d1e3e4",
"workflow_type": "SomeWorkflow"
}