Logging

Configure log levels and privacy settings to control how the Airship SDK logs messages.

The Airship SDK provides configurable log levels to help you debug issues without overwhelming the console. By default, the log level is set to Info for development builds and Error for production builds to ensure clean logs in a live environment.

Log levels

The following log levels are available, ordered from most to least verbose.

Log LevelDescription
VerboseReports highly detailed SDK status, which is useful for deep debugging and troubleshooting.
DebugReports general SDK status with more detailed information than Info.
InfoReports general SDK status and lifecycle events.
WarningUsed for API deprecations, invalid setup, and other potentially problematic situations that are generally recoverable.
ErrorUsed for critical errors, exceptions, and other situations that the SDK cannot gracefully handle.
NoneDisables all logging.

Configuring log levels

You can set the log level in the Airship config options that are passed during takeOff. This setting acts as a minimum, and only logs at that level and higher will be logged.

// Available log levels: verbose, debug, info, warning, none
await Airship.takeOff({
    default: {
        logLevel: "verbose"
    },
    ...
});
 Note

Due to how takeOff caches config, you may need to restart the app after the new takeOff before the log levels take effect.

Log privacy levels

For better security in production environments, you can control the visibility of log contents using privacy levels. This is especially useful when you need to debug a release build without exposing sensitive information.

private (default)

This is the default setting, designed to protect data in a production environment.

  • iOS: Uses os.Logger to log all messages at the private level. The content of most logs will be redacted and will not be visible in the Console app unless a special profile is installed on the device.
  • Android: Uses the standard android.util.Log. In production builds, verbose and debug messages are completely dropped and will not be logged.

public

This setting increases log visibility, making it easier to capture detailed information from release builds.

  • iOS: All logs are sent to os.Logger with a public privacy level, preventing their content from being redacted.
  • Android & iOS: To ensure visibility in production builds, verbose and debug messages are automatically elevated to the info log level.

Setting the privacy level

You can set the privacy level in the Airship config options that are passed during takeOff.

await Airship.takeOff({
    default: {
        logLevel: "verbose",
        ios: {
          logPrivacyLevel: "public"
        },
        android: {
          logPrivacyLevel: "public"
        }
    },
    ...
});
 Note

Due to how takeOff caches config, you may need to restart the app after the new takeOff before the log levels take effect.