Workflow Logging on Worker Restart

I see the Workflow.getLogger is replay safe - is it also restart safe? for example if i have a log near the end of a workflow and my worker is restarted before then, will the log be emitted since the workflow is technically in replay but has yet to emit the final log statement?

If a worker crashes while executing a workflow task, then some log statements can be duplicated.

thanks @maxim - my question was more if a worker crashes that we could have missing logs. certain logs we absolutely need - so should we emit those in side-effects?

I think in your use case using workflow logger is fine. It would emit the log since replay would not include workflow code which has not yet been executed (your workflow code at that point would not have the isReplaying flag)

thanks i’ll give it a try

The implementation that requires certain logs to be emitted sounds fragile to me.