tinylog-org / tinylog

tinylog is a lightweight logging framework for Java, Kotlin, Scala, and Android
https://tinylog.org
Apache License 2.0
695 stars 82 forks source link

Ability to apply specific writer #362

Open sleshJdev opened 1 year ago

sleshJdev commented 1 year ago

As a developer I want to have an ability to implicitly or explicitly call particular writer, not all of them. Similar to how logback's name property works. It allows you to assign particular logger(class) to particular appender e.g.

<logger name="com.example.logger.EventLogger">
    <appender-ref ref="EVENTS_ASYNC"/>
</logger>

For instance, we could add a property like writer.class to denote that this writer will be applied only if entry sent by class.

Would it be possible to have something similar in tinylog?

pmwmedia commented 1 year ago

This is a valid requirement and I could imagine having this feature in tinylog.

In the meantime, you can use a tagged logger in your particular class as a workaround.