Logging and Observability#
The Curity HAAPI SDKs ship a unified logger — HaapiLogger — that emits structured log records from every layer of the stack. The same logger handles output from the Driver, SDK, and UI Layer frameworks, so a single configuration controls the verbosity and routing for the entire client. Logs are essential for diagnosing flow failures, observing token-lifecycle events, and validating that production traffic stays free of sensitive data.
Severity Levels#
HaapiLogger supports a small set of severity levels with the standard ordering: Error is the lowest (most important, always emitted), and the higher levels add increasingly detailed records. Setting a level enables that level plus everything more severe; configuring Info emits Info, Warning, and Error.
On iOS, choose the level with HaapiLogger.setLogType(LogType.info). On Android, use HaapiLogger.setLevel(LogLevel.INFO). The older boolean flags (isErrorEnabled, isInfoEnabled, and so on) remain available but are deprecated — they only allow non-contiguous selections and are scheduled for removal in a future major version.
Follow-Up Tags#
Each log record carries a follow-up tag that identifies which subsystem emitted it. The tag prefixes are:
HAAPI_DRIVER— the Driver layer (HTTP, attestation, storage, keystore, DCR).HAAPI_SDK— the SDK layer (flow stepping, OAuth operations, mapping).HAAPI_UI— the UI layer (theming, components, layout, flow control).
Each prefix has narrower sub-tags such as HAAPI_DRIVER_HTTP or HAAPI_SDK_OAUTH. How tags affect emission differs by platform:
- iOS — tags are an emission gate.
HaapiLogger.followUpTagsdefaults to an empty array, which means no records are emitted at all. To see logs from a layer, you must add that layer’sFollowUpTag.allCasestofollowUpTagsbefore any HAAPI object is instantiated. - Android — tags are labels only, with no behavioural effect on emission. The logger gates on
enabled(a global on/off) andsetLevel(...)(severity); thefollowUpTagvalue is attached to every log record and forwarded to sinks unchanged. Filtering by tag is a sink-side concern — your customLogSink.log(...)inspects the tag, or you grep LogCat withlogcat -s 'HAAPI_DRIVER_*:V'.
The takeaway: on iOS, configure followUpTags early or no logs reach your sink; on Android, the logger emits every record regardless of tag and your sink decides what to keep.
Sensitive-Value Masking#
By default, HaapiLogger.isSensitiveValueMasked is set to true. Token values, nonces, and challenge strings are truncated or masked in log output. Disable masking only for local debugging — the SDKs emit an explicit warning every time an unmasked sensitive value is logged so it cannot ship to production by accident.
Custom Sinks#
To pipe logs into a host application’s own logger, observability platform, or crash reporter, register a LogSink implementation. The sink receives the level, follow-up tag, message, file, and line for each record and can filter, transform, or forward as needed.
How to implement this: How to Customize Logging · Logging (SDK Layer) · Logging (Driver Layer) · Upgrade — HaapiLogger setLogType Migration