Skip to content
Skills Library
Programming · Analysis

oslog

/oslog

Read, stream, and analyze Apple unified logs (OSLog) for iOS/macOS apps. Auto-detects subsystem from Logger usage or bundle identifier. Supports live log show, real-time streaming, and .logarchive analysis with full predicate reference. Use when the user asks to check app logs, stream console output, debug with OSLog, or analyze .logarchive files on iOS/macOS.

Repository
skills ↗
Licence
MIT
Last repository change
17.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 17.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Read, stream, and analyze Apple unified logs (OSLog) for iOS/macOS apps. Auto-detects subsystem from Logger usage or bundle identifier. Supports live log show, real-time streaming, and .logarchive analysis with full predicate reference. Use when the user asks to check app logs, stream console output, debug with OSLog, or analyze .logarchive files on iOS/macOS.

Original author description

Read, stream, and analyze Apple unified logs (OSLog) for iOS/macOS apps. Auto-detects subsystem from Logger usage or bundle identifier. Supports live log show, real-time streaming, and .logarchive analysis with full predicate reference. Use when the user asks to check app logs, stream console output, debug with OSLog, or analyze .logarchive files on iOS/macOS.

How it works

  1. When to Use
  2. Step 1 — Detect Subsystem
  3. Step 2 — Determine Mode
  4. Critical Rules
  5. Predicate Reference
  6. Common Workflows
Original SKILL.md headings · 133 lines, 625 words
SKILL.md preview
---
name: oslog
description: Read, stream, and analyze Apple unified logs (OSLog) for iOS/macOS apps. Auto-detects subsystem from Logger usage or bundle identifier. Supports live log show, real-time streaming, and .logarchive analysis with full predicate reference. Use when the user asks to check app logs, stream console output, debug with OSLog, or analyze .logarchive files on iOS/macOS.
---

# oslog

Read, stream, and analyze Apple unified logs for iOS/macOS apps.

## When to Use

Activate when the user asks to:
- Check, read, show, or debug app logs
- Stream logs in real time
- Analyze `.logarchive` files
- Filter system logs by process, subsystem, or message content
- Investigate crashes, errors, or unexpected behavior via logs

## Step 1 — Detect Subsystem

Auto-detect the OSLog subsystem from the project. Try these sources in order:

1. **Source code** — search for `Logger(subsystem:` in Swift files to find the actual subsystem string used in code
2. **`project.pbxproj`** — fall back to `PRODUCT_BUNDLE_IDENTIFIER` build setting (common convention is to use bundle ID as subsystem)
3. **`Info.plist`** — read `CFBundleIdentifier` value (resolve `$(PRODUCT_BUNDLE_IDENTIFIER)` if needed)
4. **Ask the user** — if all detection fails, ask for the subsystem string

Store the detected subsystem for reuse within the session.

## Step 2 — Determine Mode

### Mode A: Show Recent Logs

Query recent logs from the live system log store.

```bash
/usr/bin/log show --last <N>m --info --debug --no-pager \
  --predicate 'subsystem == "<SUBSYSTEM>"' | head -100
```

- Default to `--last 5m`, adjust based on user request
- Always pipe through `head` on first query to avoid flooding output
- Increase `head` limit or remove it only if the user asks for more

### Mode B: Stream Live Logs

Stream logs in real time from a running app.

```bash
/usr/bin/log stream --info --debug \
  --predicate 'subsystem == "<SUBSYSTEM>"'
```

- Note: `--no-pager` is not needed here — `log stream` is inherently streaming and has no pager
- Run via Bash with `run_in_background` — the stream is continuous
- Notify the user when output is available
- Stop the stream when the user is done or the task changes

### Mode C: Analyze `.logarchive`

Query an exported log archive bundle.

**Locate the archive:**
```bash
ls <path>.logarchive/Info.plist
```

**Determine time range:**
```bash
/usr/bin/log show --style ndjson --no-pager <archive> | head -1
/usr/bin/log show --style ndjson --no-pager <archive> | tail -1
```

**Query the archive:**
```bash
/usr/bin/log show --info --debug --no-pager \
  --predicate 'subsystem == "<SUBSYSTEM>"' <archive> | head -50
```

**Export a new archive (requires sudo):**
```bash
# Path must not already exist — log collect creates the directory
sudo /usr/bin/log collect --last 30m --output <path>.logarchive
```

## Critical Rules

- **Always use `/usr/bin/log`** — bare `log` conflicts with zsh builtin
- **Always include `--no-pager`** — interactive pagers hang in non-interactive contexts
- **Always pipe through `head -N`** on initial queries — archives and log stores can contain millions of entries
- **Include `--info --debug`** — by default only Default and Error/Fault levels are shown
- **Use `--style ndjson`** for programmatic parsing/counting, `--style default` for human-readable output

## Predicate Reference

See `PREDICATES.md` for the full predicate field table, comparison operators, and NSPredicate syntax. Key shorthand examples:

```bash
's=com.example.app'                                # filter by subsystem
's=com.example.app AND c=networking'               # subsystem + category
's=com.example.app AND type>=error'                # errors and faults only
's=com.example.app AND m:"timeout"'                # message contains keyword
```

## Common Workflows

**Show all errors/faults from the app:**
```bash
/usr/bin/log show --last 10m --no-pager \
  --predicate 's=<SUBSYSTEM> AND type>=error' | head -50
```

**Show logs for a specific category:**
```bash
/usr/bin/log show --last 5m --info --debug --no-pager \
  --predicate 's=<SUBSYSTEM> AND c=networking' | head -100
```

**Search for a keyword in messages:**
```bash
/usr/bin/log show --last 5m --info --debug --no-pager \
  --predicate 's=<SUBSYSTEM> AND m:"timeout"' | head -50
```

**Count events by type in an archive:**
```bash
/usr/bin/log show --no-pager --style ndjson \
  --predicate 's=<SUBSYSTEM> AND type=error' <archive> | wc -l
```

**List unique categories from the app:**
```bash
/usr/bin/log show --last 30m --info --debug --no-pager --style ndjson \
  --predicate 's=<SUBSYSTEM>' | head -500 | \
  grep -o '"category":"[^"]*"' | sort -u
```
Files in this package (4)
  • PREDICATES.md 2 KB
  • README.md 1 KB
  • SKILL.md 5 KB
  • .claude-plugin/plugin.json 1 KB

Versions

The database has no other skills named oslog.

Database snapshot: 13.11.2026 · package version a48841453d45 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100oslog-logger-defaults
    Set up logging for an Apple-platform Swift app with `os.Logger` and decide its `subsystem` / `category` naming and `privacy:` interpolation. Use when choosing a logging library (`os.Logger` vs swift-log `import Logging` vs CocoaLumberjack); when writing the first…
  • 100ios-android-logs
    Gets, filters, streams, and saves logs and crash reports from Capacitor apps on iOS Simulator, iPhone, Android emulator and devices. Explains where Capacitor output goes (iOS bridge and mirrored JS console lines are stdout-only, so missing from Console.app and `log stream`;…
  • 90native
    Native app development strategies including iOS/macOS (Apple platforms), Tauri desktop apps. Use when developing native mobile or desktop applications.
  • 90apple-runtime-telemetry-workflow
    Add and verify privacy-aware Apple unified logging and signposts in macOS, iOS, and related Apple apps. Use when designing Logger categories, diagnosing intermittent runtime behavior, collecting focused evidence, or measuring an operation with OSSignposter.
  • 100macos-telemetry
    Add and verify lightweight macOS runtime telemetry. Use when wiring Logger events or inspecting logs for windows, sidebars, menus, and actions.
  • 100xcode-test
    This skill should be used when building and testing iOS apps on the simulator using XcodeBuildMCP. It handles building, installing, launching, screenshot capture, and log analysis for iOS/macOS apps.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.