Skip to main content
All CollectionsTroubleshooting
Why do I see extra logs in Android?
Why do I see extra logs in Android?

About automatic logcat and UI logs

Jordi Giménez avatar
Written by Jordi Giménez
Updated over 2 months ago

Automatic logcat logs

Bugfender can automatically read logs from logcat, so you don't have to change anything in your application to start using Bugfender right away. It happens, however, that not only your logs will be fetched, but also some system generated logs belonging to your application will appear.

When you initialize Bugfender, this log line enables this behavior:

Bugfender.enableLogcatLogging();

In order to disable it, just remove the above line. You can still log directly to Bugfender the same way you would use android.util.Log:

Bugfender.d("networking", "this is a debug message");
Bugfender.w("networking", "this is a warning message");
Bugfender.e("networking", "this is an error message");

If you have a logging library in your application, such as SLF4J, you can plug it to Bugfender. See our List of supported libraries.

If you would like to filter the logs from logcat, you can add a callback function to enableLogcatLogging() like this:

Bugfender.enableLogcatLogging (new LogcatInterceptor () {
@Override
public InterceptedLog intercept (final InterceptedLog interceptedLog) {
// Block Levels higher than Warning
if (interceptedLog.getLevel ().ordinal () > LogLevel.Warning.ordinal ()) {
return null;
}
// Modify the rest of the logs
interceptedLog.setMessage (interceptedLog.getMessage () + " - Modified on SampleApp.java");

return interceptedLog;
}
});

Automatic UI logs 

The automated UI Event logger detects user interaction with the application, such as touches on buttons and gestures, and logs them. Also detects changes in the screen (for example UIViewControllers in a UINavigationController) and logs them.

When you initialize Bugfender, this log line enables this behavior:

Bugfender.enableUIEventLogging(this);

To disable it, just remove the above line.

If you would like to exclude particular views from logging, you can specify those views, although each platform works slightly differently:

  • On iOS: add a tag to the views you want to ignore, and pass the tag to enableUIEventLogging:(NSArray<NSNumber *> *)ignoredViewsTags

  • On Android: add a tag to the views you want to ignore, and pass the tag to enableUIEventLogging (Application, Object...)

  • On web: add an attribute called data-bf-ignore-keypress

Children of the tagged views are also excluded.

Did this answer your question?