I want to write all logs displayed in logcat into a file when my application crashes (forced close) or else also.Is there ane way to get Logs programatically ? or is there ane way to know when my application crashed? I dont want to use "adb logcat " command. Plz help me out
Asked
Active
Viewed 500 times
1 Answers
1
Have a look at this microlog4android
and also go through this question too How do you save an Android application log to a file on a physical device?
Copied "Lars Blumberg" answer for your quick reference:
$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start
Refer for more info: Viewing stdout and stderr
If you want write your own Log function, see this answer Android Writing Logs to text File

Community
- 1
- 1

Siva Charan
- 17,940
- 9
- 60
- 95