Flattr tinylog

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(String[] args) { Logger.info("Hello World!"); } }

You will see something like this in your console:

2014-11-24 14:26:10 [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 documentation.

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!

Scalable

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 75KB!