1

Logback offers method conversion word however on my machine it outputs only question mark symbol when using AsyncAppender:

2020-09-09 12:14:57.551 IOService.?: Reading network …
2020-09-09 12:14:57.551 SocketIO.?: SOCKET - Writing data…

I'm using relatively simple configuration:

<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
    <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %logger{0}.%method: %msg %n</pattern>
</encoder>

When switching to regular FileAppender (e.g. ch.qos.logback.core.rolling.RollingFileAppender) it works fine.

Is this a known issue?

Wojtek
  • 1,845
  • 1
  • 14
  • 33

1 Answers1

2

I added includeCallerData to the ASYNCSTDOUT appender and it work. There is code:

<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
    <appender-ref ref="STDOUT"/>
    <includeCallerData>true</includeCallerData>
</appender>

Look there for the original discussion

CTiPKA
  • 2,944
  • 1
  • 24
  • 27