The recommended approach is to do what Spring Boot does - build 
a jar that has all its dependent jars in a directory. A jar is just a zip file 
so you can either unzip it before running or have the start up program 
set the classpath to the directory inside the zip. Of course, that may 
mean you need a custom ClassLoader but I’d be willing to bet you can 
find something that already does this. Or build it as a Spring Boot app.

Ralph

> On Jul 7, 2022, at 4:06 AM, Alain Désilets <alaindesile...@gmail.com> wrote:
> 
> On Thu, Jul 7, 2022 at 6:14 AM Piotr P. Karwasz <piotr.karw...@gmail.com>
> wrote:
> 
>> 
>> 
>> The removal of the `Log4j2Plugins.dat` files is exactly the source of
>> the problem. Log4j2 uses these files to load the list of available
>> plugins (like the Log4j 1.2 configuration factories), if it does not
>> find them it falls back to scanning the
>> `org.apache.logging.log4j.core` package. The plugins from
>> `log4j-1.2-api` are not in this package. Instead of deleting these
>> files you should merge them using the Maven shade plugin proposed by
>> Ralph.
>> 
> 
> Thx Piotr,
> 
> This is interesting. The reason why I added this filter is that I was
> getting a
> 
> log4j2 ERROR StatusLogger Unrecognized conversion specifier
> 
> Reading about this, I found several posts that said the solution was to
> filter the Log4j2Plugins.dat files.
> 
> So I should merge the files instead?
> 
> Question: Would I get the same issue if instead of creating an Uber jar, I
> created a jar with just my project's classes, and then ran it with
> 
> -cp log4j2-compatibility-1.0.0.jar:/path/to/the/depencies/*.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to