Sunday, April 28, 2024

Reflection of thoughts #1 - Logs and Multithreaded applications

Ever since I have started working, applications have been multi-threaded. This is mostly due to the adoption of web applications in favor of desktop applications.

Due to this change; One the more difficult work that has come up is looking at the logs. For a significantly busy server, looking at the logs is not as straightforward as I would expect.

1. In the logs, each http request is represented as its own thread, so you can identify which logs belongs to which http request since the thread name is included in the log. However, it would still be jumbled.
2. However, the more difficult effect is when each http request would also spawn new background threads where each has their own name. For example: acme_Quartz_Worker-9 . With the logs being appended by many threads on-demand.. I think it is impossible to identify which worker thread belong to which http request thread..