---
title: "Privacy & Logging"
description: "Filter event data and configure logging and redaction."
search:
  tags: ["sdk", "reference", "ios"]
  keywords: ["Swift", "StoreKit", "Xcode"]
---

Control which event data leaves your app with `beforeSend`, and choose how much SDK detail appears in the console. Set both on `NuxieConfiguration` before setup; event filtering and log redaction are separate controls.

## The beforeSend hook

Return the event unchanged, return a modified event, or return `nil` to drop it:

```swift
// nuxie-doc-snippet: filter-sensitive-events
import Nuxie

let config = NuxieConfiguration(apiKey: "your_api_key")
config.beforeSend = { event in
    guard event.properties["screen"] as? String != "debug_panel" else {
        return nil
    }

    var properties = event.properties
    properties.removeValue(forKey: "ssn")
    return NuxieEvent(
        id: event.id,
        name: event.name,
        distinctId: event.distinctId,
        properties: properties,
        timestamp: event.timestamp
    )
}
try NuxieSDK.shared.setup(with: config)
```

A dropped event is not stored, sent to Nuxie, or used to trigger an Experience. This also applies to lifecycle events used by your delivery rules.

## Logging

### Log levels

```swift
// nuxie-doc-fragment: enable-debug-logging harness=config-body
config.logLevel = .debug // Include debug, info, warning, and error logs
```

| Level | Output |
| --- | --- |
| `.verbose` | Detailed internal activity. |
| `.debug` | Debugging information. |
| `.info` | Normal operations such as setup and profile requests. |
| `.warning` | Handled problems; the default. |
| `.error` | Failures. |
| `.none` | No logs. |

### Console logging

Console logging is enabled by default. To disable it:

```swift
// nuxie-doc-fragment: disable-console-logging harness=config-body
config.enableConsoleLogging = false
```

### Sensitive data masking

API keys and customer IDs are masked in SDK logs by default:

```swift
// nuxie-doc-fragment: redact-sensitive-logging harness=config-body
config.redactSensitiveData = true // Default
```

This setting affects SDK log output. Use `beforeSend` to filter event data, and apply your own policy to logs written by the app.

## On-device storage

The SDK stores identity, queued events, and Journey state across app sessions. Profiles and Experience assets are cached; iOS can remove cached data under storage pressure.

Call [`reset()`](/docs/ios-sdk/identity-and-users#resetting-identity-logout) on sign-out to clear the previous customer's active state.

### What is sent to the server

- **Events:** name, properties, customer ID, timestamp, and device context.
- **Profile requests:** customer ID and locale.
- **Purchase synchronization:** StoreKit transaction data and customer ID.
- **Feature queries:** customer ID, feature ID, and requested balance.

The SDK does not include IDFA or IDFV unless your app explicitly adds them to event properties.

<span id="next-steps" />

See [Configuration](/docs/ios-sdk/configuration) for all options and [Tracking events](/docs/ios-sdk/tracking-events) for delivery behavior.
