2

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

JAPS
  • 250
  • 4
  • 15
  • Refer this [Android logging](http://stackoverflow.com/questions/2018263/android-logging) and [How do I write outputs to the Log in Android?](http://stackoverflow.com/questions/2364811/how-do-i-write-outputs-to-the-log-in-android) – Siva Charan Dec 04 '11 at 12:47

1 Answers1

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