Difference between slf4j-log4j12 and log4j-slf4j-impl - log4j

In some projects which used slf4j and log4j I can see dependencies like
compile('org.apache.logging.log4j:log4j-core:version')
compile('org.apache.logging.log4j:log4j-api:version')
compile('org.apache.logging.log4j:log4j-slf4j-impl:version')
But some projects use slf4j-log4j12 instead of log4j-slf4j-impl. To my understanding they are both works like bridges between slf4j and log4j, but what's their difference?

Those artifacts use different versions of Log4j:
slf4j-log4j12 is a bridge between SLF4J and Log4j 1.2. Its versioning follows SLF4J.
log4j-slf4j-impl is a bridge between SLF4J 1.x (up to 1.7.x) and Log4j 2.x. Its versioning follows LOG4J2.
log4j-slf4j2-impl is a bridge between SLF4J 2.x (or higher) and Log4j 2.x. Its versioning follows LOG4J2.
Since Log4j 1.x reached end-of-life more than 7 years ago, there is no sense in using the first one in new software.

Related

Log4j migration from 1.x to 2.x package mapping table

I am migrating log4j 1.x project to 2.x. Can you please help me by providing a package mapping table where I can find the deprecated packages in 1.x and find the equivalent in 2.x

upgrading from log4j 1.2.17 to log4j 2

I have upgrade from log4j-1.2.17 to log4j-2 with needed code changes and then removed log4j and deployed log4j2. service not starting, hence, logs not generating, where I need check

weblogic version which compatibility with log4j 2.17.1

what would be the compatible weblogic versions for the log-2.17.1. any Reference link is useful.
part of my research nowhere i found related solutions in the official sites
It would be more the java version that weblogic runs on. If it supports java 8 then you would be able to use log4j 2.17.1. I think weblogic 12.1.3 onwards supports java 8.

log4j 1.2 to log4j 2 migration

I want to upgrade log4j version from 1.2 to 2.3 version. But there are many modules in application (almost 100) and I have 100 log4j.xml files. So I can't change my xml files manually. Can You suggest any automatic way?

Adding libraries to app from JBoss 7.1.1 modules

I'm using Intellij Idea 12 and the JBoss 7.1.1 app server. Do I need to add the javaee6 jar to my application library in order to deploy it?
Or, can I just add the libraries that contain implementations of Java EE technologies, such as Faces, EJB, the Java EE jar file itself and so on from the modules in JBoss AS 7.1.1?
What if, for example, I want to add JSF libraries to my app library from the modules in JBoss 7.1.1? How can I do that?
And what is situation with Maven? How are the dependencies resolved in that case?
JBoss is a Java EE 6 compliant application server, meaning that it has all the implementations of the Java EE standard on board already, These libraries are avaliabel to applications at runtime, so there is no need to add any additional libraries to use all Java EE 6 features.
If you are using maven, simply reference the libraries to be used at runtime ('provided' scope) like this
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.1_spec</artifactId>
<scope>provided</scope>
</dependency>
If you are not sure where to start, try one or several projects from the JBoss quickstarts. There is at least one for each major Java EE technology and some examples that put those technologies together.
EDIT: It seems that the real question here is how to add Java EE libs to your poroject, It depends on the build system. If you are using maven, and I would advise you to, pick a quickstart from the list - the kitchesink is a good example and take a look at the pom.xml. It is not a good idea to add an implementation of a Java EE standard to your project other than the ones provided by the application server. This might cause problems on deployment or at runtime.

Resources