Logging
v1.9.0Include application logs with bug reports.
Custom logs
Call the logging API from your app’s event handlers:
import BugScreenSDK
BugScreenSDK.log("Detailed diagnostic context", level: .verbose)
BugScreenSDK.log("Debug message", level: .debug)
BugScreenSDK.log("User tapped checkout button", level: .info)
BugScreenSDK.log("Request took longer than expected", level: .warning)
BugScreenSDK.log("Payment failed", level: .error)The level defaults to .info if you omit it.
- Your messages are attached automatically as logs.txt when you submit a report.
- The buffer keeps about 1 MB of recent logs. Older entries are dropped when it fills, and shutdown clears it.
- SDK debug output is separate from the application messages you add with the logging API.
Protect sensitive data
Log attachments are not previewed by the tester. Keep credentials and personal data out of the messages you log.
Check custom logs
Run the logging calls in your app and submit a report. Open logs.txt in Report Inbox and check for “User tapped checkout button”.
If logs.txt is missing, check that your logging calls run before you submit the report.
System logs
Add captureSystemLogs: true to your existing BugScreenSDK.configure call:
BugScreenSDK.configure(
apiKey: "fb_your_api_key_here",
captureSystemLogs: true
)System-log capture is off by default and independent of SDK debug output.
What is attached
- When the report screen opens, the SDK prepares available logs from your app’s current process in the background. They are uploaded as system-logs.txt alongside custom logs.txt only when you submit.
- Capture includes up to five minutes of logs before the report screen opened, no earlier than SDK initialization, capped at 1 MiB. Logs generated while filling in the form are excluded. Cancelling the report discards the snapshot.
- No additional device permission is needed. System logs do not use an image or video attachment slot.
When logs may be missing
- Capture has up to ten seconds to finish while the report is open. Submit waits at most two additional seconds if logs are still being prepared. If logs are unavailable or capture times out, the report is sent without system logs.
- System logs may be shortened or omitted to keep the complete upload within 4 MiB. Your other report attachments take priority.
- iOS preserves system privacy redactions. Debug and info messages and print output may be absent from the captured logs.
Review log content before enabling capture
System logs can include sensitive messages written by your app or its libraries, even if you did not pass those messages to BugScreen’s logging API.
Check a test report
Write a native system log message in your app and submit a new report. Open the report in Report Inbox and look for system-logs.txt.
If the file is missing, check that captureSystemLogs is enabled and that your app produces logs available to capture.