LOG4J in Android

前端 未结 2 1706
一整个雨季
一整个雨季 2020-12-13 22:37

I have Java Project with lot of files, which is using LOG4J. Now I am trying to Port it to Android platform. Is it possible to reuse the code as-it is, with LOG4J function c

2条回答
  •  天涯浪人
    2020-12-13 23:19

    My answer, that presents a more future-proof and lateral-thinking approach ;-).

    I was using android-logging-log4j myself for some time, but it was causing massive warnings (which actually looked like errors) while dexing.

    The log4j jar also had a lot of unnecessary stuff in it, like the Chainsaw logging UI (written in Swing, thus useless on Android).

    I've switched to logback via https://github.com/tony19/logback-android . So far I'm happy. No more massive spam while building.

    Plus, looks like log4j 1.x is not developed anymore, look at https://github.com/apache/log4j/tree/trunk - last commit many years ago.

    And logback seems to be the successor.

提交回复
热议问题