Logger Tinylog 0.8 Supports Application Servers
The DevOps Zone is brought to you in partnership with New Relic. Learn more about the common barriers to DevOps adoption so that you can come up with ways to win over the skeptics and kickstart DevOps.
In tinylog 0.8, the configuration API has been separated from the logging API. Now, the logger can be configured by a fluent interface in the program itself. Of course, it is still possible to configure the logger by environment variables or a properties file. New is that tinylog can observe properties files. This means that changes in the property file will be detected and automically reloaded. Thus, tinylog can be reconfigured at runtime.
Like all loggers, also tinylog uses the stack trace to get runtime information, such as the method or the line in which the log entry has been generated. But due to the special architecture, tinylog knows always the position of the required stack trace element (the depth). So tinylog can load only the required stack trace element and mustn’t load the full stack trace like other loggers. This is much faster. The loading of the stack trace is usually the "most expensive" operation of a logger and therefore crucial for the performance.
All tests are completely rewritten on the basis of JUnit 4.11 and Hamcrest 1.3. There are now 155 tests, which covers 94 % of the source code of tinylog according to the code coverage tool EclEmma. This shall ensure the stability of tinylog and especially prevent regressions. The new test code is 1.5 times larger than the actual source code of tinylog.
Now, tinylog isn't only as JAR available, but also as Maven artifact and as OSGi bundle. The OSGi bundle can be used as a plug-in in Eclipse RCP applications.
For the last beta version 0.9, the support of multiple logging writers is planned. This will allow for example to write simultaneously log entries to the console and in a log file. But first, Log4j Facade will be released. Log4j Facade is already in the advanced development phase and is a Log4j compatible logging API for tinylog. Log4j Facade simplifies switching from Log4j to tinylog, because it ensures that existing source code and libraries which are using Log4j for logging work with tinylog.
The JAR file of the tinylog 0.8 has a size of only 38 KB. You can download it from www.tinylog.org/download.