logback line number is not showing up in logs

I am using logback 1.2.3 . I have added the below dependency to my pom.xml <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency> My configuration looks like below <configuration> <appender name="CONSOLE" class= "ch.qos.logback.core.ConsoleAppender"> <Target>System.out</Target> <encoder> <pattern>%p [%d{yyyy-MM-dd HH:mm:ss,SSS}] %c{3}:[%C{1}:%M:%L] - [%t] - %m%n </pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref= "CONSOLE"/> <appender-ref ref="datadog"/> </root> </configuration> Filename & line number is not showing up. A question mark is coming. INFO [2018-01-12 07:06:54] c.v.s.f.FlowStoreWarmer:[?:?:?] - [FlowStoreWarmer_flow_cache_warmup_thread] - no work to do for cid 19099 Can some one let me know what is going wrong? Do I have add logback-core also as dependency? Thanks,

Is the code compiled with javac in debug mode? If the debug info is not in the class files, then there are no line numbers to be displayed
On 12 Jan 2018, at 10:18, Debraj Manna <subharaj.manna@gmail.com> wrote:
I am using logback 1.2.3 . I have added the below dependency to my pom.xml <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency> My configuration looks like below
<configuration> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <Target>System.out</Target> <encoder> <pattern>%p [%d{yyyy-MM-dd HH:mm:ss,SSS}] %c{3}:[%C{1}:%M:%L] - [%t] - %m%n</pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="CONSOLE"/> <appender-ref ref="datadog"/> </root> </configuration>
Filename & line number is not showing up. A question mark is coming.
INFO [2018-01-12 07:06:54] c.v.s.f.FlowStoreWarmer:[?:?:?] - [FlowStoreWarmer_flow_cache_warmup_thread] - no work to do for cid 19099 Can some one let me know what is going wrong? Do I have add logback-core also as dependency?
Thanks, _______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

As discussed in stackoverflow <https://stackoverflow.com/questions/48221240/logback-line-number-is-not-showing-up-in-logs> . Modifying the config like below solved the issue <encoder> <pattern>%p [%d{yyyy-MM-dd HH:mm:ss,SSS}] %c{3}:[%C{1}:%M:%L] - [%t][%file:%line] - %m%n</pattern></encoder> On Fri, Jan 12, 2018 at 3:48 PM, Debraj Manna <subharaj.manna@gmail.com> wrote:
I am using logback 1.2.3 . I have added the below dependency to my pom.xml
<dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency>
My configuration looks like below
<configuration> <appender name="CONSOLE" class="ch.qos.logback.core. ConsoleAppender"> <Target>System.out</Target> <encoder> <pattern>%p [%d{ yyyy-MM-dd HH:mm:ss,SSS}] %c{3}:[%C{1}:%M:%L] - [%t] - %m%n</pattern> </ encoder> </appender> <root level="INFO"> <appender-ref ref="CONSOLE"/> < appender-ref ref="datadog"/> </root> </configuration>
Filename & line number is not showing up. A question mark is coming.
INFO [2018-01-12 07:06:54] c.v.s.f.FlowStoreWarmer:[?:?:?] - [FlowStoreWarmer_flow_cache_warmup_thread] - no work to do for cid 19099
Can some one let me know what is going wrong? Do I have add logback-core also as dependency?
Thanks,
participants (2)
-
David Roussel
-
Debraj Manna