tinylog
tinylog is a minimalist logger for Java, optimized for ease of use.
Easy to use
The logger of tinylog is static, so it isn't necessary to create an instance of the logger before logging. By default all log entries of the level info or higher are written into the console.
import org.pmw.tinylog.Logger;
public class Application {
public static void main(final String[] args) {
Logger.info("Hello World!");
}
}
You will see something like this in your console:
2012-01-31 20:01:27 [main] Application.main() INFO: Hello World!
Configurable
tinylog can be configured by statements, arguments and/or a properties file.
So log entries of the level warning or higher can be written to a file:
-Dtinylog.writer=file -Dtinylog.writer.filename=log.txt -Dtinylog.level=warning
or in Java:
Configurator.defaultConfig()
.writer(new FileWriter("log.txt"))
.level(LoggingLevel.WARNING)
.activate();
You can find the full list of statements and arguments in the user manual.
Fast
tinylog is very small, so it's simple to optimize the logger's speed e.g. by precompiled patterns. The result can be seen in the benchmark. There tinylog was up to four times faster than the popular log4j!
Multithreading
tinylog is thread-safe. So the logger can be used in multi-threaded programs without the need of locking. All log entries are always created and written as a whole.
Running on machines with multiple cores, tinylog benefits from the additional cores. For details see the benchmark.
Small
As the name "tinylog" implies, tinylog is very small. The tinylog JAR has a size of only 38KB!
