Why logging with Log4j does not work in Android
The problem is, that log4j uses classes ofjava.beans
package e.g.
PropertyDescriptor
. Not all classes of this package are supported in Android. See
javadoc of Android's java.beans
package
.
There is a project called android-logging-log4j, which provides a convenient way to configure the log4j system properly. It also provides an appender for LogCat.
地址:
http://code.google.com/p/android-logging-log4j/
也可以直接copy taobao的开源项目athrun(http://code.taobao.org/svn/athrun)里的这个模块,lib及相关类:
android-logging-log4j-1.0.3.jar//
log4j-1.2.16.jar//这个要自己下载
LogConfigure.java
s
s