log4j的支持安卓 [英] log4j support in Android

查看:183
本文介绍了log4j的支持安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图硬塞进现有SDK到Android设备和相关性的一种所述SDK是Apache的log4j的。我可以载入我的测试程序到Android模拟器,但是当log4j的对象PropertySetter被称为程序失败,验证例外。有没有一种方法来改善这个问题?

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 android emulator but when the log4j object "PropertySetter" is called the program fails with a verification exception. Is there a way to ameliorate this issue?

推荐答案

其实使用SLF4J变成了一个非常痛苦的过程对我来说,这似乎是常见的情况,至少是对于那些使用简单的log4j的功能库。你并不真的需要换SLF4J为log4j的,只有添加两个SLF4J图书馆从 HTTP项目://www.slf4j。组织/ download.html

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:

- 的SLF4J库为Android(目前SLF4J-的Andr​​oid 1.6.1-RC1.jar)
- log4j的了SLF4J(http://www.slf4j.org/legacy.html#log4j-over-slf4j)桥。

-- 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.

后者定义由典型的实现核心log4j的类,并将其绑定到SLF4J Android的实施。一旦库添加了code ++工程。

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.

这篇关于log4j的支持安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆