tinylog
Simplify your logging with tinylog. This lightweight logging framework can be used with Java, Kotlin, Scala, and any other JVM language. tinylog is open source and runs on any Java platform (Java 6 or newer), as well as on Android (API Level 1 or higher).
Getting StartedDownload tinylog
Latest version: 2.2.1
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.
import org.tinylog.Logger;
public class Application {
public static void main(String[] args) {
Logger.info("Hello World!");
}
}
- Console via
System.out
andSystem.err
- Database via JDBC and Java EE data sources
- Files (including shared and rolling log files)
- logcat (Android only)
Many Output Options
tinylog has many writers for outputting log entries. Log entries can be written to the console, into database tables, in files, and to Android’s logcat. There are even three different file-based writers, depending on whether you simply want to write to a 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).
Configurable
tinylog is typically configured via a properties file, where you can configure writers, severity level, and much more.
writer = file
writer.file = application.log
writer.format = {class}.{method}() {message}
level = info
Fast
tinylog is optimized for the fast output of log entries, and is significantly faster than other logging frameworks, as can be seen in the benchmark.
In tinylog, the output of stack trace information (such as the method name or line number in which a log entry has been issued), will not cause any noticeable loss of performance.
Lightweight
As the name 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 157 KB.
157 KB
Open Source
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.