With the java-log-extensions library the intent is for customers to use the NewRelicLayout that formats the logs with New Relic metadata.
For customers that are using a custom Json layout they may be able to get access to the NR metadata that the library makes available so that they can add it to their custom layout by modifying it to directly add the attributes.
Below is an example that was said to work with Log4j2. We should investigate if this is a general approach that could work with any of the supported log libraries or if it would be limited to specific ones, and consider documenting it appropriately where it makes the most sense (in the main project readme if it applies to all supported logging libraries or in the readme for the specific logging libraries that it would work with).
With the java-log-extensions library the intent is for customers to use the
NewRelicLayout
that formats the logs with New Relic metadata.For customers that are using a custom Json layout they may be able to get access to the NR metadata that the library makes available so that they can add it to their custom layout by modifying it to directly add the attributes.
Below is an example that was said to work with Log4j2. We should investigate if this is a general approach that could work with any of the supported log libraries or if it would be limited to specific ones, and consider documenting it appropriately where it makes the most sense (in the main project readme if it applies to all supported logging libraries or in the readme for the specific logging libraries that it would work with).