Skip to content

[Darwin] OSLog: Historical logs show <compose failure> #588

Description

@sureshg

Env
kotlin-logging: 8.0.0-beta-01
Platform: macOS (Kotlin/Native)

When using DarwinLoggerFactory (default) on macOS, log messages are visible in live streaming but show <compose failure> when viewing historical logs.

  • Live stream (works)
$ log stream --info --predicate 'senderImagePath ENDSWITH "macos.kexe"' --style syslog
2026-01-06 17:40:05.948564-0800  localhost macos.kexe[36525]: --> GET /media-api/images.json
2026-01-06 17:40:06.101296-0800  localhost macos.kexe[36525]: <-- 200 OK /media-api/images.json (153ms)
2026-01-06 17:40:06.102392-0800  localhost macos.kexe[36525]: --> GET /media-api/videos.json
2026-01-06 17:40:06.130684-0800  localhost macos.kexe[36525]: <-- 200 OK /media-api/videos.json (28ms)
  • Historical logs (broken)
$ log show --last 5m --info --style syslog --predicate 'senderImagePath ENDSWITH "macos.kexe"'
2026-01-06 17:40:05.953183-0800  localhost macos.kexe[36525]: <compose failure [UUID]>
2026-01-06 17:40:06.105916-0800  localhost macos.kexe[36525]: <compose failure [UUID]>
2026-01-06 17:40:06.107011-0800  localhost macos.kexe[36525]: <compose failure [UUID]>
2026-01-06 17:40:06.135304-0800  localhost macos.kexe[36525]: <compose failure [UUID]>

AI says the following,

Apple's OSLog redacts dynamic content in persisted logs by default for privacy. The fix is to use the %{public}s format specifier when calling os_log, which marks the message content as safe to persist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions