Logging
All Fluss processes(CoordinatorServer/TabletServer) create a log text file that contains messages for various events happening in that process. These logs provide deep insights into the inner workings of Fluss, and can be used to detect problems (in the form of WARN/ERROR messages) and can help in debugging them.
The logging in Fluss uses the SLF4J logging interface. This allows you to use any logging framework that supports SLF4J, without having to modify the Fluss source code.
By default, Log4j 2 is used as the underlying logging framework.
Configuring Log4j 2
Log4j 2 property files
The Fluss distribution ships with the following log4j properties files in the conf directory, which are used automatically if Log4j 2 is enabled:
log4j-console.properties
: used for CoordinatorServer/TabletServer if they are run in the foreground (e.g., Kubernetes).log4j.properties
: used for CoordinatorServer/TabletServer by default.
Log4j periodically scans this file for changes and adjusts the logging behavior if necessary. By default, this check happens every 30 seconds and is controlled by the monitorInterval setting in the Log4j properties files.
Log4j 2 configuration
The following logging-related configuration options are available:
Configuration | Description | Default |
---|---|---|
env.log.dir | The directory where the Fluss logs are saved. Must be an absolute path. | log folder under Fluss’s home. |
env.log.level | Root logger level. | INFO |
env.log.max | The maximum number of old log files to keep. | 10 |
env.stdout-err.redirect-to-file | Whether to redirect the ERROR level Fluss logs to another file. | false |
Compatibility with Log4j 1
Fluss ships with the Log4j API bridge, allowing existing applications that work against Log4j1 classes to continue working.
If you have custom Log4j 1 properties files or code that relies on Log4j 1, please check out the official Log4j compatibility and migration guides.