Java: Configure with Spring and Spring Boot

New Relic offers extensions for log management that are compatible with current versions of Spring and Spring Boot. If you use Spring, read on to learn how to enable New Relic's logs in context and enrich your log data.

If you already know the logging library, you can skip directly to that documentation:

Compatibility and requirements

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