0

I have the following log format in my yml

logFormat: "[%date{dd MMM yyyy;HH:mm:ss.SSS,UTC}] - [%-5level] [%logger{0}:%line] - %msg %ex{full}%n"

For some reason it does not print the %line .. the output comes out to something like this:

[07 Apr 2015;21:39:38.377] - [WARN ] [CacheBuilder ?] - ignoring weigher specified without maximumWeight 
[07 Apr 2015;21:39:38.406] - [WARN ] [CacheBuilder ?] - ignoring weigher specified without maximumWeight 

I also tried with %L per logback documentation, but still no luck

It gives a "?" instead of the line number. This log format used to work fine with v 0.7.1

I tested the exact same thing with another standalone project using logback.xml and it worked just fine:

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>[%date{dd MMM yyyy;HH:mm:ss.SSS,UTC}] - %level [%logger{0}:%line] - %msg%n%ex{1}</pattern>
        </encoder>
    </appender>

All help appreciated !

shahshi15
  • 2,772
  • 2
  • 20
  • 24
  • maybe this is the same problem as: http://stackoverflow.com/questions/13944641/logback-ayncappender-not-printing-file-and-line-number – niekname Jun 03 '15 at 13:34

1 Answers1

0

Turns out it's dropwizard's bug. Has been around from version 0.7. Here's the ticket, the discussion and the follow up debugging:

https://github.com/dropwizard/dropwizard/issues/975#issuecomment-93728613

https://github.com/dropwizard/dropwizard/pull/995

shahshi15
  • 2,772
  • 2
  • 20
  • 24