# AppLoggerKit 1.0: privacy-conscious logging and local diagnostics for Swift, SwiftUI and UIKit

**URL:** <https://forums.swift.org/t/apploggerkit-1-0-privacy-conscious-logging-and-local-diagnostics-for-swift-swiftui-and-uikit/90611>\
**Category:** Community Showcase\
**Created:** [November 10, 2026, 7:31am UTC](https://forums.swift.org/t/apploggerkit-1-0-privacy-conscious-logging-and-local-diagnostics-for-swift-swiftui-and-uikit/90611 "2026-11-10T07:31:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dheerendra](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dheerendra/32/47241_2.png) [@dheerendra](https://forums.swift.org/u/dheerendra)\
**Post date:** [November 10, 2026, 7:31am UTC](https://forums.swift.org/t/apploggerkit-1-0-privacy-conscious-logging-and-local-diagnostics-for-swift-swiftui-and-uikit/90611/1 "2026-11-10T07:31:46Z")

</div>

Hi everyone 👋

I'd like to share **AppLoggerKit** , an open-source Swift package for structured, privacy-aware app logging. It has no third-party dependencies.

🔗 [GitHub - eeshuu/AppLoggerKit: Privacy-conscious logging and local diagnostics for Swift, SwiftUI and UIKit: OSLog, JSON Lines files, redaction, search and export. Swift Package Manager, no dependencies. · GitHub](https://github.com/eeshuu/AppLoggerKit)

### Why I built it

Most apps end up choosing between plain `print`/`OSLog` calls and a heavy remote logging SDK. I wanted something in between: logs go to the Apple unified log by default and can optionally go to local files. Sensitive data is redacted before it reaches any destination, and logs stay on the device until the user chooses to export them.

### Highlights

- **OSLog output** with level mapping and subsystem/category filtering in Console.app
- **Optional JSON Lines file logs** with rotation (by size or time), retention limits, file protection and low-storage handling
- **7 levels** from `trace` to `critical`. Messages are autoclosures, so calls below the active level cost almost nothing
- **Privacy by default** : metadata is classified as `.private`, `.sensitive` or `.url(...)`, and tokens, passwords, JWTs and `Bearer` headers are redacted automatically
- **Correlation IDs** through task-local `LogContext.withCorrelationID`
- **Search and export** : `LogReader` for paging and statistics, `LogExporter` for redacted JSONL, text or ZIP output
- **Optional SwiftUI/UIKit viewer** : `LogViewer`, `LiveLogConsole`, and a `LogExportButton` that uses ShareLink
- **Testing helpers** : `AppLogger.capturing()` for Swift Testing
- **Custom destinations** through a simple `LogDestination` protocol

### Quick look

```swift
let logger = AppLogger(configuration: .init(
    subsystem: "com.example.app",
    minimumLevel: .info,
    destinations: [OSLogDestination(), FileLogDestination(configuration: .default)]
))

logger.info("Application launched", category: "lifecycle")

// SwiftUI
ContentView().appLogger(logger)

```

### Installation (SPM)

```swift
.package(url: "https://github.com/eeshuu/AppLoggerKit.git", from: "1.0.0")

```

It's split into modules, so you only add what you need: `AppLoggerCore`, `AppLoggerOSLog`, `AppLoggerFile`, `AppLoggerUI`, `AppLoggerTesting`.

**Requirements:** iOS/iPadOS 16+, macOS 13+, Mac Catalyst 16+, Xcode 16 with the Swift 6 toolchain. MIT licensed.

To set expectations, it does **not** do remote ingestion, analytics or crash reporting. It's meant for local diagnostics.

I'd love your feedback on the API design, especially the privacy and metadata model. Issues, PRs and ⭐s are very welcome!
