'What is meaning of the number after exec in "[http-bio-8080-exec-494] [ERROR]"?

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.



Solution 1:[1]

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

Solution 2:[2]

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...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Eugene