# Elastic APM log4j2 EcsLayout

**URL:** <https://discuss.elastic.co/t/elastic-apm-log4j2-ecslayout/309649>\
**Category:** Logs\
**Created:** [July 14, 2022, 1:04pm UTC](https://discuss.elastic.co/t/elastic-apm-log4j2-ecslayout/309649 "2022-07-14T13:04:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbglazer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbglazer/32/108324_2.png) [@tbglazer](https://discuss.elastic.co/u/tbglazer)\
**Post date:** [July 14, 2022, 1:04pm UTC](https://discuss.elastic.co/t/elastic-apm-log4j2-ecslayout/309649/1 "2022-07-14T13:04:52Z")

</div>

We want to log messages using the EcsLayout in a Java app and when we add a KeyValuePair like  
 where branch is a log4j is a field in  
[org](eclipse-javadoc:%E2%98%82=MatafC the Ecs layout builds incorrectly in the log record a field  
branch= instead of labels.BRN=.  
Would appreciate for advise how to overcome this problem. lient/%5C/UserLibraries%5C/ClientLib%5C/log4j-api-2.17.2.jar%3Corg).apache.logging.log4j.ThreadContext

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 11, 2022, 1:05pm UTC](https://discuss.elastic.co/t/elastic-apm-log4j2-ecslayout/309649/2 "2022-08-11T13:05:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
