Skip to content

Instantly share code, notes, and snippets.

@AlecIsaacson
AlecIsaacson / log4j2.xml
Last active February 12, 2020 18:33
Sample log4j2.xml that adds the lines needed to enable New Relic Logs in Context for Log4J v2.x.
<!--
This is a full example showing the one line you need to add to log4j2.xml to enable New Relic Logs in Context.
Most of this file is stock - the only changes needed are shown below, flagged with comments.
-->
<?xml version="1.0" encoding="UTF-8"?>
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config"
status="WARN"
<!-- New Relic Logs in Context - Add NR Log4J extension -->
packages="com.newrelic.logging.log4j2">
@AlecIsaacson
AlecIsaacson / build.gradle
Last active February 12, 2020 18:30
Sample Build.Gradle that adds the two lines to enable New Relic Logs in Context for Log4J v2.x.
//
// This is a full example showing the two lines you need to add to your Gradle file to enable New Relic Logs in Context.
// Most of this file is stock - the only changes needed shown below, flagged with comments.
//
description = 'Ad Service'
buildscript {
repositories {
mavenCentral()
mavenLocal()