Report Logs

This section covers how Luciq automatically attaches console logs, verbose logs, and all steps made by your users before a bug report is sent for iOS apps.

Privacy Policy

A variety of log types are sent with each crash or bug report. They appear within each report in your Luciq dashboard, as shown below, Log collection stops when Luciq is shown.

We support the following types of logs:

An example of the expanded logs view from your dashboard.

User Steps

Luciq can help you reproduce issues by tracking each step a user has taken until a report is sent. Note that the maximum number of user steps sent with each report is 100.

User Steps are formatted as follows: Event in label of type class in controller For example: Tap in UITableViewCellContentView in ViewController

  • The type of events captured are tap, long press, force touch, swipe, scroll and pinch.

  • We also capture life cycle events such as entering background, entering foreground, became active, resign active, and memory warning.

  • Label refers to the label of the object that contains the event.

  • Class refers to the class of the object that contains the event.

  • Controller refers to the view that contained the event.

An example of the expanded logs view filtered by User Steps.

You can disable User Steps with the following method.

To be able to capture User Steps, we need to do method swizzling. We take an approach to swizzling that is absolutely safe and does not impact your app negatively in any way. This swizzling can be disabled if you would prefer to log the user interactions manually.


Network Logs

Luciq automatically logs all network requests performed by your app from the start of the session. Requests details, along with their responses, are sent with each report. Luciq will also show you an alert at the top of the bug report in your dashboard when network requests have timed-out or taken too long to complete. Note that the maximum number of network logs sent with each report is 100.

An example of network request logs in the Luciq dashboard.

Omitting Requests

You can omit requests from being logged based on either their request or response details.

+ [Luciq setNetworkLoggingRequestFilterPredicate:responseFilterPredicate:] allows you to specify two predicates to be evaluated against every request and response to determine if the request should be included in logs or not.

The code above excludes all requests made to URLs that have /products path. It also excludes all responses that have a success and redirection status code, thus only including requests with 4xx and 5xx responses.

requestFilterPredicate is evaluated against an NSURLRequest, while responseFilterPredicate is evaluated against an NSHTTPURLResponse.

Obfuscating Data

Requests

You can obfuscate sensitive user data in requests, like authentication tokens for example, without filtering out the whole request.

Responses

As with requests, the response object, as well as the response data, can be modified for obfuscation purposes before they are logged.

Requests Not Appearing

If your network requests aren't being logged automatically, that probably means you're using a custom NSURLSession or NSURLSessionConfiguration.

To enable logging for your NSURLSession, add the following code.

If the requests still aren't appearing

You'll need to make sure that enableLoggingForURLSessionConfiguration: was called just before using the configuration to create the session.

AFNetworking

To enable logging for AFNetworking, create the following class.

Then use IBGAFURLSessionManager to create your requests.

Alamofire

To enable logging for Alamofire, create the following class.

Then use IBGSessionManager to create your requests.

Implementing SSL pining

If you use SSL pinning, you'll need to call our APIs as the SDK takes care of intercepting and making the request in order to log it. The following code snippet should help with doing so.

Disabling Requests

Network request logging is enabled by default if it's included in your plan. To disable it, use the following method.


Luciq Logs

Luciq Logs are similar to NSLog() and print(), but they have the added benefit of having different verbosity levels. This lets you filter logs based on their verbosity level when viewing a report on your Luciq dashboard. Note that the maximum number of Luciq logs sent with each report is 1,000.

Use Luciq Logs through the following methods.

Luciq Logs with 3rd Party Loggers

If you use CocoaLumberjack or XCGLogger, you can easily route all your logs to Luciq using our log destinations. Check the instructions on GitHub for CocoaLumberjack and XCGLogger.


Console Logs

Luciq captures all console logs and displays them on your dashboard with each report. Note that the maximum number of console logs sent with each report is 500 statements with an unlimited number of characters for each statement.

Console Logs on iOS 10

Due to the changes that Apple has made to how logging works, we can only capture console logs on iOS versions prior to 10.

To work around this issue, you can add the following snippet to your AppDelegate file but outside the scope of the class to allow Luciq to capture logs automatically on iOS 10 and above.

Alternatively, you can replace all your NSLog() and print() statements with IBGLog.

Another workaround in case you are using Swift 3.0 or above is to send console logs through the following print method. Make sure to define this method outside the AppDelegate class scope in the correct place such that it becomes accessible in all your classes.


User Events

Best Practices

You can log custom user events throughout your application and they will automatically be included with each report. Note that the maximum number of user events sent with each report is 1,000.

Last updated