Skip to content

Configuration

try Auralog.initialize(AuralogConfig(
apiKey: "aura_your_api_key",
environment: "production",
globalMetadata: ["service": "ios-app"],
captureMetricKit: true,
captureUnhandledExceptions: true
))
OptionTypeDefaultDescription
apiKeyStringrequiredAuralog project API key
environmentString"production"Environment label
endpointURLhttps://ingest.auralog.aiIngest endpoint override
allowInsecureEndpointBoolfalsePermit http:// endpoints for local development
flushIntervalTimeInterval5Time between batch flushes
maxBatchSizeInt50Maximum logs per batch request
maxQueueSizeInt1000Maximum pending non-error logs before dropping oldest
maxRetryAttemptsInt5Retry cap for retryable delivery failures
retryInitialDelayTimeInterval1First retry delay
retryMaxDelayTimeInterval30Maximum retry delay
httpTimeoutTimeInterval30URLSession request/resource timeout
traceIdStringgeneratedTrace ID attached to every log
globalMetadataAuralogMetadatanoneStatic metadata merged into every log
globalMetadataProvider() -> AuralogMetadata?noneSynchronous metadata supplier invoked per log
captureMetricKitBoolfalseForward Apple MetricKit metrics and diagnostics where available. In this beta, forwarding is implemented for iOS and no-ops on other platforms
captureUnhandledExceptionsBoolfalseCapture uncaught Objective-C exceptions

Use global metadata for fields that should appear on every entry:

try Auralog.initialize(
apiKey: "aura_your_api_key",
globalMetadata: [
"app": "ios-app",
"app_version": .string(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown")
],
globalMetadataProvider: {
["user_id": currentUserId.map(AuralogValue.string) ?? .null]
}
)

The supplier runs synchronously on every log emission. Keep it cheap and avoid I/O. Per-call metadata wins on key collisions.

  • Non-error logs are queued and flushed every flushInterval.
  • error and fatal logs are prioritized onto /v1/logs/single.
  • Auralog.flush() drains pending single and batch queues.
  • 4xx responses and redirects are treated as permanent failures.
  • 5xx responses and network failures retry up to maxRetryAttempts.
  • The project API key is sent as projectApiKey, matching the other Auralog SDKs.