Avoid Boilerplate Code
tinylog has a static logger class. Therefore, it is not necessary to create a logger instance for each class in which you want to issue log entries.
Simplify your logging with tinylog. The lightweight logging framework can be used with Java, Kotlin, Scala, and any other JVM language. tinylog is open source and runs wherever Java is used: JVM, GraalVM, and Android
tinylog has a static logger class. Therefore, it is not necessary to create a logger instance for each class in which you want to issue log entries.
import org.tinylog.Logger;
public class Application {
public static void main(String[] args) {
Logger.info("Hello World!");
}
}
tinylog has multiple writers for outputting log entries. Log entries can be written to the console, to log files, to JSON files, into database tables, to syslog servers, and to Android’s logcat.
There are even four different file-based writers, depending on whether you simply want to write to a log file, to a JSON file, share a log file with several instances simultaneously, or start a new log file regularly after defined events (such as reaching a configured file size).
System.out
and System.err
tinylog is typically configured via a properties file, where you can configure writers, severity level, and much more.
level = info
writer = file
writer.file = application.log
writer.format = {class}.{method}() {message}
tinylog can be your logging framework wherever Java 6 or newer is used. Despite downward compatibility with Java 6, tinylog provides modern techniques such as support for lambdas and lazy logging.
The logging framework can be used on the JVM, on GraalVM, on Android, in native images, in Java SE projects, in Java EE projects, in JPMS projects, on OSGi platforms, and in many other environments. Example projects can be found on the external resources page.
Besides the generic logging API for Java and other JVM languages, there are also special logging APIs for Kotlin and Scala. tinylog has several adapters for processing log entries from third-party logging APIs like SLF4J. All of them can be found on the download page.
As the name already implies, tinylog is a lightweight logging framework. tinylog itself consists of only two JAR files (one for the API and the other for the implementation) without any external dependencies. Both JAR files have a combined size of only 195 KB.
tinylog is optimized for the fast output of log entries. See the benchmark page, how it performs in comparison to other logging frameworks. tinylog can easily output hundreds of thousands log entries per second.
With tinylog, log methods for disabled severity levels even literally become a no-op that the JVM can completely eliminate from the executable code.
tinylog is open source and licensed under Apache License 2.0. This means that the logging framework can be used free of charge and without any restrictions, even in commercial software.
The source code can be found on GitHub. Pull requests and issues are welcome.