Skip to content

Using tinylog with two console writers in parallel

I am using in our project.

I can configure my writer format the following way:

Configuration.set("writer", "console");
Configuration.set("writer.format", "{level}: {class-name}.{method}(): {message}");

But now I need a different output format for some loggers.

Is this possible with tinylog? If yes, can someone provide a short example how to do this?

Thanks …



You can use tags (

Configuration.set("writer1", "console");
Configuration.set("writer1.tag", "A, B");
Configuration.set("writer1.format", "{class-name}: {message}");

Configuration.set("writer2", "console");
Configuration.set("writer2.tag", "C");
Configuration.set("writer2.format", "{level}: {message}");

Tagged loggers can be created via TaggedLogger logger = Logger.tag("A").