Netflix/mantis

Ensure JobActor has JobID as part of every emitted log line

Opened this issue · 1 comments

Context

We use the slf4j logger API to emit logs from within all the actors. All these actors have a unique way of identifying themselves. For instance, the JobActor represents an instance of a running Job with a unique JobID. Thus, it would be nice to ensure all the logs emitted from the JobActor contain this information. Today, this is done in an ad-hoc fashion. Some logs have the JobID, while others don't. It would be nice to develop a more structured way of solving this.

Goals

Look at the below line from JobActor.java to understand what the problem is.

LOGGER.info("Initializing Job {}", jobId);

We manually add the jobID in log line above. However, in other places, we fail to do this—for instance, look at the example below (also from JobActor.java).

LOGGER.info("Stored mantis job");

Instead, it would be nice to have a more structured way of solving this problem—something like the one below.

jobLogger.info("Whatever");

And the expectation is that jobLogger adds the jobID to every emitted logline by default.

7ue5wu commented

Hi @sundargates, Is this issue assigned? If not, I wanna take this issue.