How to get the full syslog from android

I want to get the full system log. I am currently using the below code to get the syslog

try { final Process process = Runtime.getRuntime().exec("logcat -d -v threadtime *:I"); final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader( process.getInputStream())); String line; while ((line = bufferedReader.readLine()) != null) { lineList.add(line); } } catch (final IOException e) { Log.e(e.toString()); } 

I can get syslog successfully using the above code. He gives only the last 30 minutes of the magazine. But I want to get the full system log from my application launch. Is it possible to write a system log to our private file?

+4
source share
1 answer

To continuously write a file to a file, try the following:

 ... exec( "logcat -f cachedirectory/logfile.txt -v threadtime" ); 

See the -f option at http://developer.android.com/tools/help/logcat.html .

+1
source

Source: https://habr.com/ru/post/1492030/


All Articles