<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Splunk Log4J2 Appender in Spring Boot with Maven in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Log4J2-Appender-in-Spring-Boot-with-Maven/m-p/567479#M100791</link>
    <description>&lt;P&gt;I have a simple Maven configuration where I know the following is on the classpath (I can verify it at runtime before Spring Boot starts up in my application class):&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;com.splunk.logging:splunk-library-javalogging:1.6.2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The Maven dependency looks like:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;com.splunk.logging&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;splunk-library-javalogging&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;1.6.2&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made sure that Spring Boot is loaded this way:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;spring-boot-starter-web&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;${version.spring.boot}&amp;lt;/version&amp;gt;
  &amp;lt;exclusions&amp;gt;
    &amp;lt;exclusion&amp;gt;
      &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;spring-boot-starter-logging&amp;lt;/artifactId&amp;gt;
    &amp;lt;/exclusion&amp;gt;
  &amp;lt;/exclusions&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;spring-boot-starter-log4j2&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;2.5.4&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created an appender this way:&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;Configuration status="info" name="LoggingTesting" packages=""&amp;gt;
  &amp;lt;Appenders&amp;gt;
    &amp;lt;SplunkHttp name="SPLUNK_APPENDER_1"
                url="http://SPLUNK_IP:8088/services/collector/event"
                token="MY_TOKEN"
                source="SampleJavaAppender1"
                messageFormat="text"
                batch_size_bytes="0"
                batch_size_count="5"
                batch_interval="0"
                connect_timeout="5000"
                disableCertificateValidation="true"&amp;gt;
      &amp;lt;PatternLayout pattern="%m"/&amp;gt;
    &amp;lt;/SplunkHttp&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I launch my application, I get this error:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;main ERROR Error processing element SplunkHttp ([Appenders: null]): CLASS_NOT_FOUND&lt;BR /&gt;main ERROR Unable to locate appender "SPLUNK_APPENDER_1" for logger config "root"&lt;/P&gt;&lt;P&gt;This was all based on&amp;nbsp;&lt;A href="https://github.com/splunk/splunk-library-javalogging/blob/main/src/test/resources/log4j2.xml" target="_self"&gt;the sample Log4J2 configuration&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;What am I missing in my configuration?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 18:02:20 GMT</pubDate>
    <dc:creator>ssdarkside2</dc:creator>
    <dc:date>2021-09-17T18:02:20Z</dc:date>
    <item>
      <title>Splunk Log4J2 Appender in Spring Boot with Maven</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Log4J2-Appender-in-Spring-Boot-with-Maven/m-p/567479#M100791</link>
      <description>&lt;P&gt;I have a simple Maven configuration where I know the following is on the classpath (I can verify it at runtime before Spring Boot starts up in my application class):&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;com.splunk.logging:splunk-library-javalogging:1.6.2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The Maven dependency looks like:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;com.splunk.logging&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;splunk-library-javalogging&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;1.6.2&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made sure that Spring Boot is loaded this way:&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;spring-boot-starter-web&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;${version.spring.boot}&amp;lt;/version&amp;gt;
  &amp;lt;exclusions&amp;gt;
    &amp;lt;exclusion&amp;gt;
      &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;spring-boot-starter-logging&amp;lt;/artifactId&amp;gt;
    &amp;lt;/exclusion&amp;gt;
  &amp;lt;/exclusions&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;spring-boot-starter-log4j2&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;2.5.4&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created an appender this way:&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;Configuration status="info" name="LoggingTesting" packages=""&amp;gt;
  &amp;lt;Appenders&amp;gt;
    &amp;lt;SplunkHttp name="SPLUNK_APPENDER_1"
                url="http://SPLUNK_IP:8088/services/collector/event"
                token="MY_TOKEN"
                source="SampleJavaAppender1"
                messageFormat="text"
                batch_size_bytes="0"
                batch_size_count="5"
                batch_interval="0"
                connect_timeout="5000"
                disableCertificateValidation="true"&amp;gt;
      &amp;lt;PatternLayout pattern="%m"/&amp;gt;
    &amp;lt;/SplunkHttp&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I launch my application, I get this error:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;main ERROR Error processing element SplunkHttp ([Appenders: null]): CLASS_NOT_FOUND&lt;BR /&gt;main ERROR Unable to locate appender "SPLUNK_APPENDER_1" for logger config "root"&lt;/P&gt;&lt;P&gt;This was all based on&amp;nbsp;&lt;A href="https://github.com/splunk/splunk-library-javalogging/blob/main/src/test/resources/log4j2.xml" target="_self"&gt;the sample Log4J2 configuration&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;What am I missing in my configuration?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 18:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Log4J2-Appender-in-Spring-Boot-with-Maven/m-p/567479#M100791</guid>
      <dc:creator>ssdarkside2</dc:creator>
      <dc:date>2021-09-17T18:02:20Z</dc:date>
    </item>
  </channel>
</rss>

