I'm using logback-android(https://github.com/tony19/logback-android), and I'm trying to set some logback pattern. then I refer to quick start in logback-android pages.
But I don't know what means about <tagEncoder>.
What's this? and What's difference between <encoder>?
<configuration>
<appender name="logcat" class="ch.qos.logback.classic.android.LogcatAppender">
<tagEncoder>
<pattern>%logger{12}</pattern>
</tagEncoder>
<encoder>
<pattern>[%-20thread] %msg</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="logcat" />
</root>
</configuration>
As we know, logs in android have TAG and Message structure https://developer.android.com/reference/android/util/Log.html
So tagEncoder would make TAG, and encoder would make Message in your log
You can use encoder without TAG, but it would be better to use TAGs too, for easy sort and search in logcat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With