Addendum: For converting to the configuration files, I found some instructions on this page https://logging.apache.org/log4j/2.x/migrate-from-log4j1.html#configuration-file-migration related to running the command java org.apache.log4j.config.Log4j1ConfigurationConverter \ --in log4j.properties --out log4j2.xml but it does not provide instructions on where to run this. Trying to run it from terminal throws class not found exception log4j1configruationconverter, despite having the artifacts log4-api, log4j-core and log4j-1-2.api in the pom.xml.
Thank you again, Alex On Mon, Mar 3, 2025 at 9:52 AM Alex Smith <a.sloni...@gmail.com> wrote: > Unfortunately, as this is an enterprise product, I can't share those > files. If there is specific information you are looking for from them, I > may be able to provide an excerpt with pertinent information > redacted/removed. > To the other questions, > Migrating to lo4j2 version 2.20.0 > Open JDK 17.0.14 > OS: Amazon Linux version 2023, ID like Fedora 2023 > > W/r/t the log4j configuration, it appears we're using multiple log4j.xml > files, some of which are log4j2 and otheru sing log4j, so I don't think > they have been converted. Is there a page I can reference with instructions > on how to convert those files? > > Thank you for the help, > Alex > > > On Sun, Mar 2, 2025 at 10:15 AM Volkan Yazıcı <vol...@yazi.ci> wrote: > >> Hey Alex, >> >> You're at the right place to ask Log4j-related questions. Would you mind >> providing a little bit more information about your setup, please? >> >> 1. Which Log4j 2 version are you migrating to? >> 2. Which OS and JDK distribution are you using? >> 3. Is this a standalone or a JEE/Jakarta application? >> 4. I presume you converted your Log4j 1 configuration to Log4j 2. Could >> you share your Log4j configuration? (e.g., `log4j2.xml`) >> 5. Could you share your `pom.xml` file? >> 6. Could you share your application logs when you start the application >> with the `log4j2.debug` system property? >> >> Kind regards. >> >> On Fri, Feb 28, 2025 at 8:03 PM Alex Smith <a.sloni...@gmail.com> wrote: >> >> > I'm not sure I'm in the right place, but I've been working on migrating >> > from Log4j to Log4j 2 in a project I'm working on. >> > >> > In the pom.xml, I removed the log4j dependencies and added the log4j >> > compatibility API to hte dependencies. I think some of of the other >> > dependencies I'm using may still be on log4j 1.2, but am not 100% >> certain >> > of this. >> > >> > What I'm observing is that trying to add >> > import org.apache.logging.logj4.x is frequently throwing errors related >> to >> > ClassNotFoundException, and when attempt to build some of the services, >> I >> > get amongst others, the following errors >> > >> > "StatusLogger Log4j2 could not find a logging implementation please add >> > log4j-core to the classpath... " >> > and >> > "Invocation of init method failed; nested exception is >> > java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/logEvent" >> > >> > As mentioned above, log4j-core is listed as a dependency in the pom.xml >> > file, so I can't imagine why the files wouldn't be found in the >> classpath. >> > >> > I've been following the instructions from >> > https://logging.apache.org/log4j/2.x/migrate-from-log4j1.html, and am >> > struggling to find any information as to why the errors listed above >> might >> > be caused. If anyone has any insight on this or how to potentially >> resolve >> > it, I'd be extremely grateful. >> > >> > I think I've supplied all the relevant information, but if there's >> anything >> > I'm missing I can easily look into it and provide whatever I find. >> > >> > Thanks, >> > Alex >> > >> >