Getting Data In

Splunk Log4J2 Appender in Spring Boot with Maven

ssdarkside2
Explorer

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):

com.splunk.logging:splunk-library-javalogging:1.6.2

The Maven dependency looks like:

<dependency>
  <groupId>com.splunk.logging</groupId>
  <artifactId>splunk-library-javalogging</artifactId>
  <version>1.6.2</version>
</dependency>

 

I made sure that Spring Boot is loaded this way:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
  <version>${version.spring.boot}</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-logging</artifactId>
    </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-log4j2</artifactId>
  <version>2.5.4</version>
</dependency>
  

 

I created an appender this way:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" name="LoggingTesting" packages="">
  <Appenders>
    <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">
      <PatternLayout pattern="%m"/>
    </SplunkHttp>

 

When I launch my application, I get this error:

main ERROR Error processing element SplunkHttp ([Appenders: null]): CLASS_NOT_FOUND
main ERROR Unable to locate appender "SPLUNK_APPENDER_1" for logger config "root"

This was all based on the sample Log4J2 configuration .

What am I missing in my configuration?

Labels (1)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...