[slf4j-dev] [JIRA] Updates for SLF4J-493: Lambda expression call with log4j logs the wrong line number

QOS.CH (JIRA) noreply-jira at qos.ch
Thu Jun 25 14:40:00 CEST 2020


SLF4J / SLF4J-493 [Open]
Lambda expression call with log4j logs the wrong line number

==============================

Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.

View or comment on issue using this link
https://jira.qos.ch/browse/SLF4J-493

==============================
 Issue created
------------------------------

Daniel Gray created this issue on 25/Jun/20 2:25 PM
Summary:              Lambda expression call with log4j logs the wrong line number
Issue Type:           Bug
Assignee:             SLF4J developers list
Created:              25/Jun/20 2:25 PM
Environment:          Any, with the latest (2.0.0-alpha1) version of SLF4J.
Priority:             Major
Reporter:             Daniel Gray
Description:
  The logger output the wrong log line (120 for INFO, 117 for DEBUG, etc.) instead of the line in the program that generated the log, when running against a Log4J backend. This causes potential confusion when a person debugging something is reading the logs as the line numbers are wrong!
  
  I know that it is SLF4J that is doing something wrong instead of Log4J, because running just with Log4J does not manifest the same behavior.
  
  I have prepared 2 simple CLI apps to show the correct behavior (with only Log4J) and the incorrect behavior (with SLF4J). Both are using the exact same configuration (log4j2.properties). The repositories of these sample projects are:
  
  Good behavior with log4j:
   [https://github.com/danielthegray/log4j-nobugsample]
   Wrong behavior with slf4j:
   [https://github.com/danielthegray/slf4j-bugsample]
  
   
  
  Both of the programs run with a simple "./gradlew run" so it should be straightforward to reproduce.


==============================
 This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)



More information about the slf4j-dev mailing list