Java: Configure with Spring and Spring Boot

New Relic offers extensions for New Relic Logs that are compatible with current versions of Spring and Spring Boot. If you use Spring, this document will help you enable New Relic's logs in context and start receiving log data in New Relic.


The goal of this document is to help you figure out what logging library you're using, so that you can configure it to enable New Relic's logs in context. If you already know the logging library, you can skip directly to that documentation:

Compatibility and requirements

Access to logs in context requires a New Relic APM Pro or Pro trial subscription and enabling of distributed tracing. Before enabling distributed tracing, read the transition guide to learn about the effects on existing APM features and set-up recommendations.

To use New Relic logs in context with Logback, ensure your configuration meets the following requirements:

With Spring Boot

The extensions support default configurations only on Spring Boot 2.0 and higher.

For users of Spring Boot, here are tips for determining which logging library you have:

With Spring (but not Spring Boot)

Spring 5 or higher:

  • Spring implements a bridge to other logging libraries that will automatically find them. However, those individual libraries must be configured and explicitly included in your project dependencies. Consult your Gradle, Maven, or other build tool's dependency tree to identify your logging dependency. Then visit the individual library page for more information.

Spring 4 or lower:

For more help

Recommendations for learning more: