Network logs are automatically collected by Instabug when possible. There are many way to configure and manipulate these logs from the code.
To log network requests, use
InstabugNetworkLog then use the following method at the
responseBody. A more detailed example can be found here.
InstabugNetworkLog networkLog = new InstabugNetworkLog(); networkLog.Log(urlConnection, requestBody, responseBody);
In order to log Okhttp requests, first make sure that you compiled Instabug with a network interceptor. By adding the following to your Gradle:
An example of the implementation can be found on the right hand side of this section.
InstabugOkhttpInterceptor instabugOkhttpInterceptor = new InstabugOkhttpInterceptor(); OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(interceptor) .addInterceptor(instabugOkhttpInterceptor) .build();