[ 
https://issues.apache.org/jira/browse/LOG4J2-3460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

DarkGoofy updated LOG4J2-3460:
------------------------------
    Description: 
When we upgraded our Spring to use log4j 2.17.1 the structured logs no longer 
contained any structured fields we added to the log statement.

I am logging several structured arguments as follows

 
{code:java}
log.info("Get container",
                v("TENANT_ID", tenantId),
                v("CONTAINER_ID", containerId)){code}
 

NOTE: That class is instrumented with@Log4j2 (lombok)

but not seeing the arguments in the JSON in the log file
{code:java}
{
  "app":"Signal Service",
  "ts":"2022-02-02T18:22:21.312Z",
  "level":"INFO",
  "class":"com.tbd.platform.signal.controller.ContainerController",
  "method":"getContainer",
  "caller_file_name":"ContainerController.java",
  "line":153,"thread":"http-nio-8080-exec-2", 
  "msg":"Get container"
} {code}
This issue is linked with the commit : 
[https://github.com/apache/logging-log4j2/commit/487588b7c34bc0b540e769d98c42d018fa1bc1b8]

!LOG4J2-3460.png!

 

Why the parameters (message.getParameters()) is not propaged (the null value is 
propaged) ?

 

 

 

  was:
When we upgraded our Spring to use log4j 2.17.1 the structured logs no longer 
contained any structured fields we added to the log statement.

I am logging several structured arguments as follows

{{        log.info("Get container",
                v(StructuredLoggingFields.TENANT_ID, tenantId),
                v(StructuredLoggingFields.CONTAINER_ID, containerId));}}
NOTE: That class is instrumented with@Log4j2

but not seeing the arguments in the JSON in the log file

{{{
  "app":"Signal Service",
  "ts":"2022-02-02T18:22:21.312Z",
  "level":"INFO",
  "class":"com.tbd.platform.signal.controller.ContainerController",
  "method":"getContainer",
  "caller_file_name":"ContainerController.java",
  "line":153,"thread":"http-nio-8080-exec-2", 
  "msg":"Get container"
}}}
 

This issue is linked with the commit : 
[https://github.com/apache/logging-log4j2/commit/487588b7c34bc0b540e769d98c42d018fa1bc1b8]

 

!JwcnOoqgAAAAAElFTkSuQmCC!

Why the parameters (message.getParameters()) is not propaged (the null value is 
propaged) ?

 

 

 


> Structured fields are no longer printed when using log4j 2.17.1
> ---------------------------------------------------------------
>
>                 Key: LOG4J2-3460
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3460
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Log4j-to-SLF4J
>    Affects Versions: 2.17.1
>            Reporter: DarkGoofy
>            Priority: Major
>         Attachments: LOG4J2-3460.png
>
>
> When we upgraded our Spring to use log4j 2.17.1 the structured logs no longer 
> contained any structured fields we added to the log statement.
> I am logging several structured arguments as follows
>  
> {code:java}
> log.info("Get container",
>                 v("TENANT_ID", tenantId),
>                 v("CONTAINER_ID", containerId)){code}
>  
> NOTE: That class is instrumented with@Log4j2 (lombok)
> but not seeing the arguments in the JSON in the log file
> {code:java}
> {
>   "app":"Signal Service",
>   "ts":"2022-02-02T18:22:21.312Z",
>   "level":"INFO",
>   "class":"com.tbd.platform.signal.controller.ContainerController",
>   "method":"getContainer",
>   "caller_file_name":"ContainerController.java",
>   "line":153,"thread":"http-nio-8080-exec-2", 
>   "msg":"Get container"
> } {code}
> This issue is linked with the commit : 
> [https://github.com/apache/logging-log4j2/commit/487588b7c34bc0b540e769d98c42d018fa1bc1b8]
> !LOG4J2-3460.png!
>  
> Why the parameters (message.getParameters()) is not propaged (the null value 
> is propaged) ?
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to