OSLog reads and inspects unified logging entries from the log store on iOS, macOS, tvOS, watchOS, and visionOS. Open an OSLogStore and use an OSLogEnumerator, starting from an OSLogPosition, to iterate over recorded OSLogEntry values, including OSLogEntryLog messages, OSLogEntryActivity and OSLogEntryBoundary markers, and OSLogEntrySignpost entries. Through protocols such as OSLogEntryFromProcess and OSLogEntryWithPayload, you examine each entry's originating process, log level, and payload components like OSLogMessageComponent.
Accessing the Log Store 3
Open the unified logging store and iterate its recorded entries from a given position.
- ClOSLogStoremacOS 10.15+@class OSLogStore
- ClOSLogEnumeratormacOS 10.15+@class OSLogEnumerator
- ClOSLogPositionmacOS 10.15+@class OSLogPosition
Log Entries 5
The base entry type and the specific kinds of records you read from the store.
- ClOSLogEntrymacOS 10.15+@class OSLogEntry
- ClOSLogEntryLogmacOS 10.15+@class OSLogEntryLog
- ClOSLogEntryActivitymacOS 10.15+@class OSLogEntryActivity
- ClOSLogEntryBoundarymacOS 10.15+@class OSLogEntryBoundary
- ClOSLogEntrySignpostmacOS 10.15+@class OSLogEntrySignpost
Entry Payloads and Metadata 3
Protocols and components that expose each entry's originating process, level, and message contents.
- PrOSLogEntryFromProcessmacOS 10.15+@protocol OSLogEntryFromProcess
- PrOSLogEntryWithPayloadmacOS 10.15+@protocol OSLogEntryWithPayload
- ClOSLogMessageComponentmacOS 10.15+@class OSLogMessageComponent