Upload
infinum
View
50
Download
10
Embed Size (px)
Citation preview
Why?• It is possible to enable logging at runtime • It’s possible to change log levels at runtime • Log statements can stay in production ape without incurring a heavy performance
cost • It gives the developer detailed context for application failures • The target of the log output can be a file, an OutputStream, a java.io.Writer, a
remote log4j server… • Automatic backup
Android-logging-log4j
• We will not use log4J directly • Android-logging-log4j is a library build on top of log4j • Makes logging very simple while keeping all log4j features
Log anything
!OUTPUT: 2014-07-02 18:34:52,762 - [ERROR::root::com.example.ivankocijan.log4jexample.MyActivity] - something
Custom logger
OUTPUT: 2014-07-02 18:34:52,769 - [ERROR::This is my logger:: com.example.ivankocijan.log4jexample.MyActivity] - something else
Log4j 2
• Still in beta • API Separation - core is separated from logger API • Improved Performance • Plugin Architecture • ….
Resources
• http://logging.apache.org/log4j/1.2/manual.html • https://code.google.com/p/android-logging-log4j/ • http://mindpipe.blogspot.com/2011/11/android-log4j-exception-properties.html • http://logging.apache.org/log4j/2.x/ • http://gradleplease.appspot.com/