javajettyslf4jlogbackrunjettyrun

Logback showed line number as -1


I'm using SLF4J with logback in my web application. Logs show the line number as -1 instead of actual line. I see this issue when I use jetty runner. I don't see this issue when I run my application in eclipse through run-jetty-run. Below is my pattern.

<pattern>[%d{dd MMM yyyy HH:mm:ss,SSS}] [%5p] [%X{sid}] [%-20C{0} %25M]:[%-4L] - %replace(%m){'\n', '\\n'}%n</pattern>

Solution

  • My build file has no debug=on in javac. That is why I see this issue in jetty-runner. In Run-jetty-run classes built by eclipse are used instead of ant.