Skip to content

vignesh-j-shetty/NanoLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NanoLogger

High performance logging library. With very low latency and configurable features.

Design

Here Consumer-Producer technique is used here to decouple logging function that is called by applications or users. Producer runs on same thread as of application/user. Consumer run on its own thread. Consumer and Producer interact through lock-free ring buffer data structure. Consumer blocking reads (blocked when buffer is empty) from buffer and Producer writes to buffers without any lock contention.

Usage

    Logger logger = new Logger(Main.class.getName());
    logger.fatal("Log message {} {}", 1, 2.3);
    logger.warn("Warning {}", 1);

For sample config refer resources folder.

Performance

  • Apache log4j Average latency: 1798750 ns
  • NanoLogger Average latency: 15709 ns

(Note that these performance measures are specific to machine used to test)

About

High performance logging framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages