# APM agent console log formatting from log4j2 configuration

**URL:** <https://discuss.elastic.co/t/apm-agent-console-log-formatting-from-log4j2-configuration/301196>\
**Category:** Elastic Observability\
**Created:** [March 31, 2022, 1:07pm UTC](https://discuss.elastic.co/t/apm-agent-console-log-formatting-from-log4j2-configuration/301196 "2022-03-31T13:07:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudolfs\_Sulcs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rudolfs_sulcs/32/98729_2.png) [@Rudolfs\_Sulcs](https://discuss.elastic.co/u/Rudolfs_Sulcs)\
**Post date:** [March 31, 2022, 1:07pm UTC](https://discuss.elastic.co/t/apm-agent-console-log-formatting-from-log4j2-configuration/301196/1 "2022-03-31T13:07:07Z")

</div>

Hi, is there any way format elastic apm agent console logging message? For example:

```auto
2022-03-31 15:53:38,437 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean

```

to something like this?

```auto
[2022-03-31T15:53:38,437] [main] [INFO] [co.elastic.apm.agent.util.JmxUtils] [Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean]

```

or

```auto
[2022-03-31T15:53:38,437] [INFO] [co.elastic.apm.agent.util.JmxUtils] Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean

```

Application uses log4j2 configuration with layout pattern: `[%d{ISO8601}][%p][%c] %m%n` and only applies to its application logging messages.

Regarding logging configuration options: [Logging configuration options | APM Java Agent Reference [master] | Elastic](https://www.elastic.co/guide/en/apm/agent/java/master/config-logging.html) looks like there isn't property to determine log4j2 properties file for apm agent like e.g. `-Delastic.apm.log4j2_properties_file=log4j2.xml`

Is this something that is not implemented or possible to implement in the future?

Thanks.

---

<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:** [November 4, 2022, 8:34am UTC](https://discuss.elastic.co/t/apm-agent-console-log-formatting-from-log4j2-configuration/301196/2 "2022-11-04T08:34:56Z")

</div>


