use of core.framework.impl.log.ActionLog in project core-ng-project by neowu.
the class WebServiceClient method linkContext.
private void linkContext(HTTPRequest httpRequest) {
ActionLog actionLog = logManager.currentActionLog();
// web service client may be used without action log context
if (actionLog == null)
return;
httpRequest.header(HTTPServerHandler.HEADER_REF_ID.toString(), actionLog.refId());
if (actionLog.trace) {
httpRequest.header(HTTPServerHandler.HEADER_TRACE.toString(), "true");
}
}
use of core.framework.impl.log.ActionLog in project core-ng-project by neowu.
the class Scheduler method submitJob.
void submitJob(Trigger trigger, boolean trace) {
jobExecutor.submit(() -> {
try {
ActionLog actionLog = logManager.begin("=== job execution begin ===");
String name = trigger.name();
actionLog.action("job:" + name);
if (trace) {
actionLog.trace = true;
}
Job job = trigger.job();
actionLog.context("job", name);
actionLog.context("jobClass", job.getClass().getCanonicalName());
job.execute();
return null;
} catch (Throwable e) {
logManager.logError(e);
throw e;
} finally {
logManager.end("=== job execution end ===");
}
});
}
Aggregations