HomeDocumentationAPI Reference
Getting StartedAPI ReferenceDashboardHelp Center
Documentation

Report Logs for iOS

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

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

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:


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.
2177

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

You can disable User Steps with the following method.

Luciq.trackUserSteps = false
Luciq.trackUserSteps = NO;

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. For more details, you can check here. 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. These logs are sent with each bug and crash report and provide valuable context for debugging, including the request URL, method, status code, and duration. Luciq will also show an alert in your dashboard if a request timed out or took too long to complete.

For detailed instructions on how to configure automatic network logging, handle custom network stacks like Alamofire, or log requests manually, please see our comprehensive guide:

View the Complete Network Logging for iOS Guide

2040

An example of network request logs in the Luciq dashboard.


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.

LCQLog.log("Log statement")
LCQLog.logVerbose("Verbose statement")
LCQLog.logInfo("Info statement")
LCQLog.logWarn("Warning statement")
LCQLog.logDebug("Debug statement")
LCQLog.logError("Error statement")
LCQLog(@"Log message");
LCQLogVerbose(@"Verbose log message");
LCQLogDebug(@"Debug log message");
LCQLogInfo(@"Info log message");
LCQLogWarn(@"Warn log message");
LCQLogError(@"Error log message");

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.

inline void NSLog(NSString *format, ...) {
    va_list arg_list;
    va_start(arg_list, format);
    LCQNSLogWithLevel(format, arg_list, LCQLogLevelDebug);
    va_end(arg_list);
}

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

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.

public func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
    let output = items.map { "\($0)" }.joined(separator: separator)
    
    Swift.print(output, terminator: terminator);
		LCQLog.log(output)
}

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 Luciq 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 and they will automatically be included with each report. Note that the maximum number of user events sent with each report is 1,000.

Luciq.logUserEvent(withName: "Skipped Walkthrough")
[Luciq logUserEventWithName:@"Skipped Walkthrough"];

What’s Next

Logs go hand-in-hand with both bug and crash reporting, so why not give those a look? The Session Profiler feature also give you more comprehensive details alongside logs.