devonfw-forge / mrchecker-source

Mr.Checker E2E source files
Apache License 2.0
16 stars 4 forks source link

We probably use wrong log4j related dependencies #28

Open other019 opened 4 years ago

other019 commented 4 years ago

Expected behaviour: Put log4j config to src/main/resources to be able to configure logging. Actual behaviour: Either version of config https://logging.apache.org/log4j/2.x/manual/configuration.html#XML for log4j in version 2 or https://logging.apache.org/log4j/2.x/manual/migration.html for log4j in version 1 yields an error.

Steps to reproduce: Put log4j.xml config to src/main/resources in project using mrchecker.

Comments: https://stackoverflow.com/questions/47574644/difference-between-slf4j-log4j12-vs-log4j excerpt from mvn dependency:tree of mrchecker-core-module

[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.2:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.2:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] |  \- log4j:log4j:jar:1.2.17:compile

it is showing that we are using log4j api and core in version 2.2 but slf4j which is a facade for loger is using log4j 1.2 (probably thats what 12 stand from).

I will provide the fix in near future. Affected version: OS: Windows

KMariusz commented 1 year ago

Is this still valid for latest version? We have config file log4j2.xml at src/test/resources I've configured there debug logs from io.netty and it works