While going through an investigation in a legacy Java Spring Maven project deployed on tomcat 7 the logs stated like below-
2018-08-29 18:16:42:471 +0600 [http-bio-8080-exec-494] [ERROR]
Asking to demystify the number after
exec-
So basically the meaning of "exec"? which is 494 for the above case.
It's most probably the thread id generated by a custom ThreadFactory
, just like:
Executor executor = Executors.newFixedThreadPool(4, new ThreadFactory() {
AtomicInteger threadId = new AtomicInteger(0);
@Override
public Thread newThread(Runnable r) {
return new Thread(r, "http-bio-8080-exec-" + threadId.getAndIncrement()); // custom a thread factory
}
});
IntStream.range(0, 10).forEach(value -> {
executor.execute(() -> {
System.out.println(Thread.currentThread().getName()); // print thread name
try {
Thread.sleep(100);
} catch (Exception e) {
}
});
});
OutPut:
http-bio-8080-exec-0
http-bio-8080-exec-1
http-bio-8080-exec-2
http-bio-8080-exec-3
http-bio-8080-exec-0
http-bio-8080-exec-3
http-bio-8080-exec-1
http-bio-8080-exec-2
http-bio-8080-exec-0
http-bio-8080-exec-3
That is a Thread ID number generated by a Thread Pool in tomcat. The real question is different, this being an internal information what is the value of it, now that you know about it? I'd assume close to zero...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With