@MobileTen I mean an application extension, such as an action extension, notification content extension, notification service extension etc. I've rephrased the question to hopefully make it more understandable:
Is there a way of using Logger/OSLogStore such that logging performed within an extension can later be retrieved by the application?
For example suppose an app is logging like this:
let logger = Logger(subsystem: "com.mysubsystem.log", category: "app")
logger.debug("app stuff")
and suppose an extension (such as a notification service extension for example) logs like this:
let logger = Logger(subsystem: "com.mysubsystem.log", category: "ext")
logger.debug("ext stuff")
Then next time the app runs, if it attempts to retrieves the log with code such as:
let logStore = try! OSLogStore(scope: .currentProcessIdentifier)
let oneHourAgo = logStore.position(date: Date().addingTimeInterval(-3600))
let allEntries = try! logStore.getEntries(at: oneHourAgo)
for entry in allEntries {
look at the content of the entry
Then within the for loop, there's lots and lots of stuff retrieved, including "app stuff", but there is no "ext stuff". Is there anyway the application can retrospectively retrieve logging performed within the extension?