Skip to main content

Privacy and console logs

Bugsee automatically captures all standard application console logs. The feature can be either completely disabled or logs can be sanitized during recording to strip any PII data.

Disabling log collection

Console log collection can be disabled completely using BugseeCaptureLogsKey launch option. See configuration for more info.

Sanitizing logs

Your class should implement the BugseeDelegate protocol and it must set itself as the delegate for Bugsee.

-(void)bugseeFilterLog:(BugseeLogEvent *)log completionHandler:(BugseeLogFilterDecisionBlock)decisionBlock
{
// Below is an example that replaces the access_token value in all URLs
// going through the filter with a fixed placeholder.
NSError * error;
NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:@"access_token=[0-9a-z\\-]*"
options:NSRegularExpressionCaseInsensitive error:&error];
log.text = [regex stringByReplacingMatchesInString:log.text
options:0
range:NSMakeRange(0, log.text.length)
withTemplate:@"access_token=<redacted>"];
decisionBlock(log);
}

// ..somewhere within the class
[Bugsee sharedInstance].delegate = self;

More about console logs - Logging

Found an issue, typo, or wrong statement on this page? Report it now →