logcat--目录 logcat命令使用方法和查看android系统日志缓冲区内容的方法:--http://www.warting.com/program/201606/166297.html; 如何获取 android 的系统日志 logcat; android抓取各种log的方法:http://www.kuqin.com/shuoit/20160205/350536.html Android命令行工具logcat详细用法!:http://www.miui.com/article-272-1.html

logcat--目录
logcat命令使用方法和查看android系统日志缓冲区内容的方法:--http://www.warting.com/program/201606/166297.html;
如何获取 android 的系统日志 logcat;
android抓取各种log的方法:http://www.kuqin.com/shuoit/20160205/350536.html
Android命令行工具logcat详细用法!:http://www.miui.com/article-272-1.html

 

 

 代码实现获取log日志和logcat使用方法:http://www.apkbus.com/android-128263-1-1.html

 

http://www.eoeandroid.com/thread-153626-1-1.html?_dsign=633e68ac;

 

如何获取 android 的系统日志 logcat

 

android抓取各种log的方法:http://www.kuqin.com/shuoit/20160205/350536.html

 

Android命令行工具logcat详细用法!:http://www.miui.com/article-272-1.html

 

 

------1,在android程序中,如何将LogCat上的日志输出到文件?
最近在做一个android项目,需要将日志输出到手机上,比如sdCard上,
根据我的了解LogCat上打印出来的日志到手机上是不能被输出到文件的,
请问大家谁有没什么方法或者思路,能帮我将日志输出到文件?


LogCat存储在circular memory buffers中。

1、可以通过命令来导出Log:

    引用--adb logcat -d > logcat.txt

2、在程序中获取Log的方法:

引用
<uses-permission android:name="android.permission.READ_LOGS" />

public class LogTest extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

try {
Process process = Runtime.getRuntime().exec("logcat -d");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));

StringBuilder log=new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
log.append(line);
}
TextView tv = (TextView)findViewById(R.id.textView1);
tv.setText(log.toString());
} catch (IOException e) {
}
}
}

详细参考
http://www.helloandroid.com/tutorials/reading-logs-programatically