TechnologiesDeveloper Tools & Diagnostics

OSLog

iOSmacOStvOSwatchOSvisionOS

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.

  • Cl
    OSLogStoremacOS 10.15+
    @class OSLogStore
  • Cl
    OSLogEnumeratormacOS 10.15+
    @class OSLogEnumerator
  • Cl
    OSLogPositionmacOS 10.15+
    @class OSLogPosition

Log Entries 5

The base entry type and the specific kinds of records you read from the store.

  • Cl
    OSLogEntrymacOS 10.15+
    @class OSLogEntry
  • Cl
    OSLogEntryLogmacOS 10.15+
    @class OSLogEntryLog
  • Cl
    OSLogEntryActivitymacOS 10.15+
    @class OSLogEntryActivity
  • Cl
    OSLogEntryBoundarymacOS 10.15+
    @class OSLogEntryBoundary
  • Cl
    OSLogEntrySignpostmacOS 10.15+
    @class OSLogEntrySignpost

Entry Payloads and Metadata 3

Protocols and components that expose each entry's originating process, level, and message contents.

  • Pr
    OSLogEntryFromProcessmacOS 10.15+
    @protocol OSLogEntryFromProcess
  • Pr
    OSLogEntryWithPayloadmacOS 10.15+
    @protocol OSLogEntryWithPayload
  • Cl
    OSLogMessageComponentmacOS 10.15+
    @class OSLogMessageComponent
← Developer Tools & Diagnostics