Async Logging: The Speed Boost Your Java Apps

Amit Himani
4 min readFeb 11, 2024

In the fast-paced realm of software development, where milliseconds matter and system responsiveness is quality requirement, the journey from traditional synchronous (sync) logging to the asynchronous (async) counterpart has proven to be a game-changer. As a seasoned developer, you know the importance of optimizing performance, especially in high-stakes environments. Having worked on a sophisticated investment banking application, I grappled with the challenge of achieving optimal response times, pushing the boundaries of what seemed feasible — 400 TPS. Auditing was crucial, but traditional logging was like an anchor on speed. Then, we made a bold move: asynchronous logging. And let me tell you, it was the game-changer we never knew we needed.

Curious how we pulled it off? Buckle up, because this blog dives into the thrilling world of async logging. I’ll delve into a pivotal moment in our development saga, where the transition to async logging, coupled with strategic application and infrastructure tweaks, not only met but exceeded our expectations

Lets create simple Java application to demonstrate impact of async logging. I will be using JDK 17 with dependencies like log4j-api.2.17.1 , log4-core.2.17.1 and lmax disruptor.4.0.0

Code is available here on GitHub.

--

--

Amit Himani

Cloud Architect with 15 years of experience. I enjoy reading about emerging technologies, staying up-to-date on tech and sharing with others through this blog