September 2018
Intermediate to advanced
462 pages
13h 28m
English
In Java, we use an API to get Logger. Using the API, a module can provide an implementation for the service LoggerFinder, which in turn can return Logger implementing the getLogger() method. This eliminates the dependency of libraries on specific loggers or logger facades, which is a huge advantage. The smaller but still annoying issue requiring us to write the name of the class again as the parameter to the getLogger() method remains.
To avoid this cumbersome task, we create a helper class that looks up the caller class and retrieves the logger that is suitable for the caller class and module. Because in this case there is no need for all the classes referenced in the stack trace, we will call the
Read now
Unlock full access