Skip to main content

Class: WorkflowLogInterceptor

worker.WorkflowLogInterceptor

This interceptor used to be meant to log Workflow execution starts and completions, and attaches log attributes to workflow.log calls. It is now deprecated and behaves as a noop in all cases. It is only kept arround to avoid breaking code out there that was previously refering to it.

Deprecated

WorkflowLogInterceptor is deprecated. Workflow lifecycle events are now automatically logged by the SDK. To customize workflow log attributes, simply register a custom WorkflowInterceptors that intercepts the outbound.getLogAttributes() method.

Implements

Constructors

constructor

new WorkflowLogInterceptor(): WorkflowLogInterceptor

Returns

WorkflowLogInterceptor

Methods

execute

execute(input, next): Promise<unknown>

Called when Workflow execute method is called

Parameters

NameType
inputWorkflowExecuteInput
nextOmitLastParam<(input: WorkflowExecuteInput, next: OmitLastParam<(input: WorkflowExecuteInput, next: OmitLastParam<...>) => Promise<unknown>>) => Promise<unknown>>

Returns

Promise<unknown>

result of the Workflow execution

Implementation of

WorkflowInboundCallsInterceptor.execute


getLogAttributes

getLogAttributes(input, next): Record<string, unknown>

Called on each invocation of the workflow.log methods.

The attributes returned in this call are attached to every log message.

Parameters

NameType
inputGetLogAttributesInput
nextOmitLastParam<(input: GetLogAttributesInput, next: OmitLastParam<(input: GetLogAttributesInput, next: OmitLastParam<...>) => Record<string, unknown>>) => Record<string, unknown>>

Returns

Record<string, unknown>

Implementation of

WorkflowOutboundCallsInterceptor.getLogAttributes