Keys and Values for OSLog entries filtered by NSPredicate

It's very nice that I can enumerate the entries in my application logs. I've used NSPredicate to great effect over the past few decades. To use it most effectively, however, you need to know what keys an object has.

I have not yet found any documentation which tells you what keys (and their value types) that you can use in the NSPredicate you pass to getEntries(with:at:matching:)

By trial and error (ok... mostly trial and assumption). I found I can use "subsystem = %@". I might assume things like category and date are in there. How about log level?

Are the available keys and associated value types documented?

Try this:

% log help predicates
valid predicate fields:
    activityIdentifier                    (integer)
    …

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Keys and Values for OSLog entries filtered by NSPredicate
 
 
Q