Skip to main content

Privacy and console logs

Bugsee automatically captures all standard applications 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 BugseeDelegate protocol and it must set itself as the delegate for Bugsee.

-(void)bugseeFilterLog:(BugseeLogEvent *)log completionHandler:(BugseeLogFilterDecisionBlock)decisionBlock
{
// Below is an example code that will remove access_token from all URLs going through the filter.
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:@"TokenWasFound here"];
decisionBlock(log);
}

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

More about console logs - Logging