I see that if an uncaught exception occurs in a process activity, it gets logged multiple times (three in my experience) by the camunda engine.
For example, I created a process delegate with just the following code as the body:
throw new RuntimeException("***** TEST ERROR");
In the log, I see the following entries (I cut the long stack traces):
2019-05-29 14:55:59,515 ERROR [camundaTaskExecutor-1] context: ENGINE-16004 Exception while closing command context: ***** TEST ERROR
java.lang.RuntimeException: ***** TEST ERROR
2019-05-29 14:55:59,518 WARN [camundaTaskExecutor-1] jobexecutor: ENGINE-14006 Exception while executing job 1aec7622-8211-11e9-b54f-84bb9855545b:
java.lang.RuntimeException: ***** TEST ERROR
2019-05-29 14:55:59,548 WARN [camundaTaskExecutor-1] jobexecutor: ENGINE-14006 Exception while executing job 1aec7622-8211-11e9-b54f-84bb9855545b:
java.lang.RuntimeException: ***** TEST ERROR
(The second and the third entries seem to be completely identical.)
Is it intentionally that one error is logged multiple times? I’d rather have it so that one error is logged only once, because otherwise it’s very confusing.
do you mean that the three log entries come from the fact that the engine per default executes a job three times before giving up?
I assure this is not the case. The three log entries are issued during one job execution. When the job is executed the second and the third time, the three entries appear again (each time). The only difference (in my experiment) were different time stamps and thread names (“camundaTaskExecutor-2” and “camundaTaskExecutor-3”).
Sorry, I failed to mention that in my original post.
My impression (from the previous experience in some other java projects) is that an exception is caught somewhere in the code, gets logged and is then passed up the call stack. There it’s logged again and is again passed further.
I’ll set the log threshold for the job executor to ERROR, hope I won’t miss some important entries after that.
Just a couple of thoughts:
IMO it’s not good that the job executor logs the same exception twice. Setting the threshold to ERROR eliminates the problem for the user, but it sill exists in the code.
It would be even better if the context would produce just one log entry with all the information combined.