5

I am working on Android 3.0. I have a service that is started on boot and I have some debug logging in it.
The problem is that I can't see the logs in the LogCat since the default log level is INFO after boot. Sometimes after boot when I run from shell 'getprop log.tag.MyTag' I get an empty line. Can't figure why.
I know that sometimes Android show debug logs even if it is set to INFO, but I have a check before each log print of the if the log level is enabled.

How can I change the default log level of a project?

Yaniv
  • 3,321
  • 8
  • 30
  • 45

1 Answers1

4

Try this if you're doing it from the command line:

adb logcat *:D

If you're in Eclipse, the filters are in the upper right corner of the LogCat view.

In AndroidManifest.xml:

<application ... android:debuggable="true">
robamaton
  • 690
  • 1
  • 6
  • 17
  • Also, make sure that Debug Mode is set both in the application and on the device. – robamaton Jul 11 '11 at 13:26
  • This is my problem, after boot of the device the service comes back to INFO log level and I can't see the logs. I want it to load on DEBUG level. – Yaniv Jul 11 '11 at 13:43
  • Well, the *.D is supposed to set the log filter to DEBUG and higher for all components. You launched it that way and still don't see debug logs? And you set the app and the device to be debuggable? – robamaton Jul 11 '11 at 13:49
  • I tried to see that from eclipse and can't see. The app is set to INFO level after boot, how do I set it to DEBUG by default? – Yaniv Jul 11 '11 at 13:52
  • Put android:debuggable="true" in the application tag. – robamaton Jul 11 '11 at 14:00
  • It is already exists. Let me explain again my question: before the line Log.d() I check the log level and if DEBUG is not enabled I won't print the log. I can't disable it for now. If I will cause this application to have a default log level DEBUG, I think it will resolve the problem. – Yaniv Jul 11 '11 at 14:07
  • I have a similar problem. On one of my devices I can never get logs below "Info", whereas on an emulator, or a different device I can get logs at "Verbose", or "Debug" without a problem. I've tried "adb setprop log.tag.MyTag VERBOSE" and "adb logcat *:D" (and setting filter levels in Eclipse) but nothing shows those logs to me unless I switch to a different device. – karora Nov 22 '11 at 11:53