I am trying to use log4j2 through log4j-1.2-api in the context of an
uber-jar created with the maven shade plugin and am experiencing issues.

I wrote a simple HelloWorld class that illustrates the issue.

When I run this class through intelliJ, everything works fine. But when I
run it through a terminal, I get

ERROR StatusLogger Reconfiguration failed: No configuration found for
'55f96302' at 'null' in 'null'

In both cases, I invoke the command with


And the log4j.properties is in the old log4j style (i.e. NOT log4j2 style).

Not sure what I am doing wrong.

One thing I notice is that the class path is different in both situations.
When running through intelliJ, it contains a great number of jars,


whereas when I run it from terminal, it just contains my one uber-jar. But
based on the content of my pom, I expect that the uber jar will contain
classes from those same log4j jars.

Here are the details of this HelloWorld example.

This is the HelloWorld class

package org.examples;

import org.apache.log4j.Logger;

import java.net.URL;
import java.net.URLClassLoader;

public class HelloWorld {

  public static void main(String[] args) {
    Logger logger = Logger.getLogger("org.examples.HelloWorld");
    logger.trace("Hello from Logger");

  private static void printClassPath() {
    ClassLoader cl = ClassLoader.getSystemClassLoader();
    URL[] urls = ((URLClassLoader)cl).getURLs();

    System.out.println("Class path is:");
    for(URL url: urls){

And here is the pom:

<project xmlns="http://maven.apache.org/POM/4.0.0";



      <!-- Use shade plugin to create an uber-jar with all dependencies -->
                <!-- This file may contain some log4j configuration that
                    is not in sync with the actual version of log4j we
                    use. So we exclude all versions of that file that
                    might be inherited from a dependency-->





And here is the log4.properties file

# Log to stdout only
log4j.rootLogger=warn, stdout

# Configure the stdout logger
log4j.appender.stdout.layout.ConversionPattern =-- %c{2}: %m%n

# Activate some traces

Reply via email to