Skip to main content

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

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.
View official skill

Logging Model

LogConfiguration controls:

SettingDefaultPurpose
level.infoMinimum severity recorded by the default logger.
destination.xlfacilityActive output destination.
logsDirectory.aibuds/logsFile destination directory relative to Documents.
maxFileSize10,000,000 bytesMaximum size of a single file log.
logFileMaxAge3 daysRetention age used for log cleanup.

LogDestination supports .console, .oslogger, .file, and .xlfacility. Only one destination is active at a time.

Integration Flow

  1. Configure the level, destination, storage, and retention settings early in application startup.
  2. If using .xlfacility, install the AIBudsXLFacility plugin before logs are written.
  3. Record messages through AIBudsLogSDK.logService or allow AIBuds modules to use the same service.
  4. 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.logService returns the built-in DefaultLogger.
  • Selecting .xlfacility without configuring its plugin falls back to an error message in the console and cannot persist or export through XLFacility.