FAQ

  1. Why yet another logging framework?
  2. How can I provide my own logger implementation?
  3. What if there are multiple LoggerFactory bindings?
Why yet another logging framework?

Because logging in Java is a MASSIVE drain on resources. The original Log4J (not log4j2 mind you) increased the average run of a machinelearning run by 500% when the logging was turned off. Yes it was worse when you decided to turn it on.

This nice review here proves that any self implemented logging framework can easily outperform the default java loggers.

[top]


How can I provide my own logger implementation?

Seshat uses the java ServiceLoader concept in order to load different LoggerFactory implementations. This means that, if you want to provide your own logger, you need to do the following steps:

  1. Implement a custom LoggerFactory that implements the science.aist.seshat.LoggerFactory interface.
  2. Register your own factory as a Service. This is achieved by creating a META-INF/services folder inside your module. Put a file with the name science.aist.seshat.LoggerFactory in this folder and write your fully qualified class name into the first line (e.g. com.mycompany.MyLoggerFactory). Java will then automatically find this factory as a Service, and it will be loaded from our service loader and used as a LoggerFactory.

[top]


What if there are multiple LoggerFactory bindings?

The service loader uses the first LoggerFactory that is registered as a Service. So if you have multiple LoggerFactory services registered in your classpath, this leads to an undefined state, where the first LoggerFactory is used, that is returned from the Service Loader. Compare here.

[top]