I have the following maven configuration:
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>slf4j-tinylog</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-api</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-impl</artifactId>
<version>2.2.0</version>
</dependency>
My Java program is the following:
public static void main(final String[] args)
{
Configuration.set("w1", "console");
Configuration.set("w1.tag", "SYSTEM");
Configuration.set("w1.format", "SYSTEM: {message}");
Configuration.set("w2", "console");
Configuration.set("w2.tag", "-");
Configuration.set("w2.format", "DEFAULT: {message}");
final org.slf4j.Logger log = LoggerFactory.getLogger(MyLogging.class);
log.info("Output for slf4j");
Logger.tag("SYSTEM").info("Output for SYSTEM");
Logger.info("Output for Default");
}
The result is the following:
2020-10-31 11:07:32 [main] de.MyLogging.main()
INFO: Output for slf4j
2020-10-31 11:07:32 [main] de.MyLogging.main()
INFO: Output for SYSTEM
2020-10-31 11:07:32 [main] de.MyLogging.main()
INFO: Output for Default
It seems that the configuration is not taken at all.
I would have expected the following output:
DEFAULT: Output for slf4j
SYSTEM: Output for SYSTEM
DEFAULT: Output for Default
What is wrong with my code?