Log4J for android

guide :http://tony19.github.com/logback-android/

pattern for print exception

http://logback.qos.ch/manual/layouts.html#nopex

add logback.xml in /assets/


        <configuration>
            <appender
                name="LOGCAT"
                class="ch.qos.logback.classic.android.LogcatAppender" >
                <tagEncoder>
                    <pattern>%logger{0}%nopex</pattern>
                </tagEncoder>
                <encoder>
                    <pattern>%msg%n</pattern>
                </encoder>
            </appender>

            <root level="ERROR" >
                <appender-ref ref="LOGCAT" />
            </root>
        </configuration>

 

你可能感兴趣的:(Log4J for android)