9

The latest update to Google Play Services 7.3 makes GA's Logger interface deprecated, and thus we cannot control the logging level from inside our app anymore.

This interface is deprecated.

Logger interface is deprecated. Use adb shell setprop log.tag.GAv4 DEBUG to enable debug logging for Google Analytics.

We used to have different settings per build type, using Logger.setLogLevel() (the guide seems to be outdated): verbose for debug and error for release, so that our tracking information is available only to us during development.

Now with latest update, anyone who can run

adb shell setprop log.tag.GAv4 VERBOSE

will be able to see what we are sending to Google Analytics, or anyone can see what everyone else is logging (those who use 7.3).

Is there any way to avoid this?

hidro
  • 12,333
  • 6
  • 53
  • 53

2 Answers2

1

According to documentation use adb shell setprop log.tag.GAv4 DEBUG in android studio terminal but make sure you connect one device only then enter adb logcat -v time -s GAv4 in terminal to start track logger

Logger

Google Analytics will log to logcat under the GAv4 tag using the Android Log system. By default only ERROR, WARN and INFO levels are enabled. To enable DEBUG level run the following adb command on your device or emulator:

adb shell setprop log.tag.GAv4 DEBUG To see only Google Analytics messages from logcat use the following command:

adb logcat -v time -s GAv4

reference https://developers.google.com/analytics/devguides/collection/android/v4/advanced#logger

Mina Fawzy
  • 20,852
  • 17
  • 133
  • 156
0

In the Google Analytics changelog page you can see that GA Version 4.5 is the version which is included in Google Play Services 7.3 (May 1, 2015)

https://developers.google.com/analytics/devguides/changelog

You can change the default Logger to a custom implementation:

Custom implementations of Logger can also be used:

// Provide a custom logger.
GoogleAnalytics.getInstance(this).setLogger(new CustomLogger());

See: https://developers.google.com/analytics/devguides/collection/android/v4/advanced

Oded Regev
  • 4,065
  • 2
  • 38
  • 50
  • 1
    Well, `GoogleAnalytics.setLogger(Logger)` is also deprecated. https://developers.google.com/android/reference/com/google/android/gms/analytics/GoogleAnalytics.html#setLogger(com.google.android.gms.analytics.Logger) – hidro Oct 18 '15 at 11:46