Bug 63046 - Switch to standard logging framework for logging
Summary: Switch to standard logging framework for logging
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 4.0.x-dev
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2018-12-31 11:57 UTC by PJ Fanning
Modified: 2021-02-22 19:34 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description PJ Fanning 2018-12-31 11:57:32 UTC
Allows POI users more control over how they want to log.

Probably a pretty big task.
Comment 1 Axel Howind 2019-01-07 14:59:07 UTC
Why not use log4j2 instead which now offers the same functionality that SLF4J does (seperation of API and backend), seems to perform better and has more functionality? What's more, it's an Apache project.

There's an interesting discussion on stackoverflow in the comments to [this](https://stackoverflow.com/questions/41498021/is-it-worth-to-use-slf4j-with-log4j2) question, where one of the log4j2 devs and Ceki (the one behind SLF4J) are involved. Oh, and of course the answer by itself is also worth a read.

After trying both, I would say: if your project already uses SLF4J, stick with it. If not, use Log4j2.

What's more: SLF4J on Android is dead for more than 4 years now. I don't know how easy it is running POI on Android (I just googled and found at least two projects that do it), but it would be definitely easier if the used logging framework supports the platform.
Comment 2 PJ Fanning 2019-01-07 15:18:43 UTC


Avoid lock-in
Applications coded to the Log4j 2 API always have the option to use any SLF4J-compliant library as their logger implementation with the log4j-to-slf4j adapter.

My preference would still be for slf4j-api. And users who want log4j2 can use https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl/2.11.1
Comment 3 Axel Howind 2019-01-08 16:40:13 UTC
I think technical there's not much difference between SLF4J and Log4j2 regarding lock-in. Both separate API and Implementation (which was not the case with the old log4j) and can be used with different backends. You can use log4j2 and log to any SLF4J backend or vice-versa.

But honestly, there doesn't seem to be much life left in SLF4J. The last check-in is from march 2018. Just have a look at the repo and the dev list. Same goes for logback (same dev).

SLF4J now already lacks features that the JDK Logger introduced in JDK 8 (message suppliers to prevent creating temporary objects being an example). The SLF4J feature request dates from 2016, and it doesn't seem there will be much happening anytime soon.

Maybe it would be worth reaching out to Ceki/qos and ask if SLF4J is still alive before deciding.
Comment 6 PJ Fanning 2021-02-21 22:52:44 UTC
this appears to be causing build problems in the java 16 build -- https://ci-builds.apache.org/job/POI/job/POI-DSL-1.16 -- other builds seem to be ok
Comment 7 Marius Volkhart 2021-02-22 19:34:18 UTC
Thanks, fixed in 1886811