Logging Overview
AIBudsLogSDK provides the process-wide logging entry point used by AIBuds SDK modules and applications. Its active LogService records messages, exports retained logs, and purges expired entries.
Available Features
Output Methods
Configure the active AIBuds logging level and output destination
Export Logs
Export retained AIBuds logs to one file or size-limited files
Delete Expired Logs
Purge retained logs by maximum age or cutoff date
Implement with AI Assistance
Build with AI
Implement this workflow with AI
Use the official Manage AIBuds Logs skill to adapt this workflow to your app.
Read and follow https://docs-aibuds.github.io/skills/manage-aibuds-logs. Use it to implement Manage AIBuds Logs in this iOS project and verify the result.Logging Model
LogConfiguration controls:
| Setting | Default | Purpose |
|---|---|---|
level | .info | Minimum severity recorded by the default logger. |
destination | .xlfacility | Active output destination. |
logsDirectory | .aibuds/logs | File destination directory relative to Documents. |
maxFileSize | 10,000,000 bytes | Maximum size of a single file log. |
logFileMaxAge | 3 days | Retention age used for log cleanup. |
LogDestination supports .console, .oslogger, .file, and .xlfacility. Only one destination is active at a time.
Integration Flow
- Configure the level, destination, storage, and retention settings early in application startup.
- If using
.xlfacility, install theAIBudsXLFacilityplugin before logs are written. - Record messages through
AIBudsLogSDK.logServiceor allow AIBuds modules to use the same service. - Export or purge logs through the active
LogService.
Important Behavior
- Console and OS Logger destinations do not support export.
- File and XLFacility destinations support export and retention cleanup.
- If no custom service is installed,
AIBudsLogSDK.logServicereturns the built-inDefaultLogger. - Selecting
.xlfacilitywithout configuring its plugin falls back to an error message in the console and cannot persist or export through XLFacility.