I am using the AWS SWF Flow framework for Java and I would like to inject a Logentries Logger inside the workers so I can easily monitor them.
Right now I am instantiating a Logback logger instance in each Workflow implementation, giving it the implementation identity. However, I also want to know which worker the implementation is running on.
public class CopyWorkflowImpl implements CopyWorkflow {
private Logger log;
private CopyActivitiesClient operations = new CopyActivitiesClientImpl();
public CopyWorkflowImpl(){
//TODO: somehow get worker ID ?
log = LoggerFactory.getLogger("CopyWorkflowWorker");
}
I could see that the WorkflowWorker class has a getIdentity method exactly for that, however, I can't seem to access it inside the Workflow implementation. Do you have any ideas on how I could achieve that ?
workflowExecutionId
orrunId
during the execution of the workflow? You are in the scope of a workflow here, not an actual workflow worker. – mkobit