log4j support in Android

后端 未结 6 1310
無奈伤痛
無奈伤痛 2020-11-27 04:57

I am attempting to shoehorn an existing SDK onto an android device and one of the dependencies of said SDK is Apache log4j. I am able to load my test program onto the androi

6条回答
  •  醉梦人生
    2020-11-27 05:53

    Actually using slf4j turned out a remarkably painless process for me, and it seems the common case, at least for libraries that use straightforward log4j features. You don't really need to swap slf4j in for log4j, only add two slf4j libraries to your project from http://www.slf4j.org/download.html:

    -- the slf4j library for Android (currently slf4j-android-1.6.1-RC1.jar)
    -- the log4j over slf4j (http://www.slf4j.org/legacy.html#log4j-over-slf4j) bridge.

    The latter defines the core log4j classes used by typical implementations and bind them to the slf4j Android implementation. Once the libraries are added the code works.

提交回复
热议问题