Welcome to Instabug's Documentation!
Here you'll find a comprehensive technical guide
to help you start working with the Instabug SDK efficiently.

Get Started

Report Logs

This section covers how Instabug automatically attaches the console logs, the verbose logs, all the steps done by the user until a bug report is sent.

🚧

Privacy Policy

It is highly recommended to mention in your privacy policy that you may be collecting logging data in order to assist troubleshooting bugs.

A variety of logs types are sent with each bug report. They will appear within each report on your Instabug dashboard as shown below. The cut-off point of the log collection is when Instabug is shown. We support the following types of logs:

Logs - Dashboard

User Steps

Instabug can detect user steps that can help you regenerate a bug in your app. To Allow or disallow Instabug to record user steps, you need to call the following method.

//iOS
Instabug.TrackUserSteps = true;

//Android
new Instabug.Builder(this, "ANDROID_APP_TOKEN")
            .SetInvocationEvent(InstabugInvocationEvent.Shake)
            .SetTrackingUserStepsState(Feature.State.Disabled)
                        .Build();

Network Logs

🚧

Supported on Android only

The network logs are currently supported on Android only.

Instabug offers logging for all network requests performed by your app. Requests details, along with their responses, are going to be sent with each report. Instabug will also show an alert in the bug report when it finds that some network requests have timed-out or have taken too long to complete.

Logging HttpUrlConnection requests

To log network request, use InstabugNetworkLog then use the following method at the HttpUrlConnection, Request body and response body

InstabugNetworkLog networkLog = new InstabugNetworkLog();
networkLog.Log(urlConnection, requestBody, responseBody);

For a more detailed example see the following network request

protected override Java.Lang.Object DoInBackground(params Java.Lang.Object[] @params){
  HttpURLConnection urlConnection = null;
  Java.IO.BufferedReader reader = null;
  String responseBody = null;
  try 
  {
    URL url = new URL("url");
    urlConnection = (HttpURLConnection)url.OpenConnection();
    urlConnection.RequestMethod="GET";
    urlConnection.UseCaches = false;
    urlConnection.ConnectTimeout=10000;
    urlConnection.ReadTimeout=10000;
    urlConnection.Connect();
    // Read the input stream into a String
    System.IO.Stream inputStream = urlConnection.InputStream;
    Java.Lang.StringBuffer buffer = new Java.Lang.StringBuffer();
    if (inputStream == null)
    {
      return null;
    }
    reader = new Java.IO.BufferedReader(new Java.IO.InputStreamReader(inputStream));
    String line;
    while ((line = reader.ReadLine()) != null)
    {
      buffer.Append(line + "\n");
    }
    if (buffer.Length() == 0)
    {
      return null;
    }
    responseBody = buffer.ToString();
    //logging network request to instabug
    InstabugNetworkLog networkLog = new InstabugNetworkLog();
    networkLog.Log(urlConnection, requestBody, responseBody);
    return jsonStr;
  }
  catch (IOException e)
  {
    Log.Error("LoginActivity","error: ",e);
    return null;
  }
  finally
  {
    if (urlConnection != null)
    {
      urlConnection.Disconnect();
    }
    if (reader != null)
    {
      try
      {
        reader.Close();
      }
      catch (IOException e) 
      {
        Log.Error("LoginActivity", "error: ", e);
      }
    }
  }
}

Instabug Logs

You can log messages throughout your application's lifecycle. Those logs are going to be sent with each report.

//iOS
IBGLog.LogInfo("info");
IBGLog.LogWarn("warning");
IBGLog.LogVerbose("verbose");
IBGLog.LogDebug("debug");
IBGLog.LogError("error");

//Android
InstabugLog.W("Warning message");
InstabugLog.E("Error message");
InstabugLog.I("Information message");
InstabugLog.V("Verbose message");
InstabugLog.D("Debug message");
InstabugLog.Wtf("Failure message");

Console Logs

Instabug automatically captures the console logs and display them on your dashboard with each report. We currently capture the console logs coming from the native code only.

If you don't want to send the console logs parallel with the report you can disable this feature as follows.

//Android
new Instabug.Builder(this, "ANDROID_APP_TOKEN")
            .SetInvocationEvent(InstabugInvocationEvent.Shake)
            .SetConsoleLogState(Feature.State.Disabled)
                        .Build();

User Events

🚧

Best Practices

Currently the limit of the number of user events sent with each report is 1,000. If you're planning on logging a large amount of unique data, the best practice here would be to use Instabug Logging instead. The reason for this is that having a very large amount of user events will negatively impact the performance of the dashboard.

Having a large amount of user events will not affect dashboard performance if the user events are not unique.

You can log custom user events throughout your application. Events are automatically going to be included with each report.

//iOS
Instabug.LogUserEventWithName("User Event");

//Android
Instabug.LogUserEvent("My Event");

Updated 5 months ago


What's Next

Logs go hand-in-hand with both bug reporting, so why not give that a look? The Session Profiler could also help give you more details alongside the logs.

Bug Reporting
Session Profiler

Report Logs


This section covers how Instabug automatically attaches the console logs, the verbose logs, all the steps done by the user until a bug report is sent.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.