一、log 分类
aplog
modem log
anr
log
panic log
tombstones log
dropbox log
monkey log
二、aplog
aplog 是分析android 系统问题的基本log,不管是应用crash、
ANR
还是别的各种系统异常,aplog都是很有必要的。
1). aplog 包含android log 和 kernel log,通过
logcat 命令可以捕获。
service apk_logfs /system/bin/logcat -b system -b events -b main -b
radio -n 20 -r20480 -v threadtime -f
/data/logs/aplog
class late_startdev/log
disabled
seclabel u:r:apk_logfs:s0
这里是在rc 文件里定义的一个log 服务,这样就可以在需要时start这个服务。比如user 版本默认log都是关闭的,但是在user版本遇到问题需要log 时就可以在工程应用里打开log服务捕获log。
-b 指的是要捕获那个缓冲区的log,一般有system events main radio crash
kernel 六种类型缓冲区,前5种是android 默认的,kernel 是各平台商自加,实现各不一样,使用时会有差异。有的打印kernel log 需要logcat -b kernel
,有的就不需要。
frameworks/base