The specific usage is as follows:
1. Download
Download the http://code.google.com/p/microlog4android/downloads/list and microlog. properties files to the microlog4android-1.0.0.jar
2. Create a logger object
Private Static final logger = loggerfactory. getlogger (main. Class );
3.ProgramThe initialization method in the oncreate method of the first activity
Propertyconfigurator. getconfigurator (this). Configure ();
4. Put the microlog. properties file in the assets folder.
Note: The assets folder is the same as the res folder.
Then change the microlog. properties file to the following:
Microlog. Level = debug
Microlog. appender = logcatappender; fileappender
Microlog. formatter = patternformatter
Microlog. formatter. patternformatter. pattern = % C [% P] % m % t
5. Write log records
Logger. debug ("this is debug information ");
6. Add SD card write permission in androidmanifest. xml
<Uses-Permission Android: Name = "android. Permission. write_external_storage"/>
After running the program, you can find a microlog.txt file, which contains our logs.