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
Airship.takeOff({
  default: {
    logLevel: "verbose"
  },
  ...
});

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.

public

This setting increases log visibility, making it easier to capture detailed information from release builds. 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.

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