Thread ID Format
search cancel

Thread ID Format

book

Article ID: 205673

calendar_today

Updated On:

Products

CA API Gateway API SECURITY CA API Gateway Precision API Monitoring Module for API Gateway (Layer 7) CA API Gateway Enterprise Service Manager (Layer 7) STARTER PACK-7 CA Microgateway

Issue/Introduction

The number of digits of Thread ID output to Gateawy log varies from time to time.

For reference, some examples of the The Thread ID is shown in BOLD below:-
2020-10-23T14:16:50.814+0800 INFO    4073 com.l7tech.server.admin.AdminSessionManager: Authenticated on Internal Identity Provider
2020-10-29T11:11:20.032+0800 INFO 884893 com.l7tech.server.admin.AdminSessionManager: Authenticated on Internal Identity Provider
2020-10-29T14:42:58.836+0800 INFO    1192 com.l7tech.server.admin.AdminSessionManager: Authenticated on Internal Identity Provider
2020-10-29T11:23:54.623+0800 INFO    885020 com.l7tech.server.admin.AdminSessionManager: Authenticated on Internal Identity Provider

What is  the numeric range (i.e. the possible length (number of digits))?

Environment

Release : ALL

Component : API GATEWAY

Resolution

Numeric range is positive long number of java.  The OS provides threadID when the application (GW) process initializes a new thread.  The longer the process runs the higher the threadID becomes. During a process life time you can have low values of long running threads and higher values for thread that start then stop - short running 

When logging need to know a thread only process one request as a time sin order to see a complete process grep for a specific threadID 

In java, the threadid is positive long number,
https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getId-

Then it can be as high as 263-1 (9,223,372,036,854,775,807)
In reality, it seems there is no chance to reach that limit.