I'm debugging very rarely occuring problem in my NetworkExtension. For this I rely on logs being saved by OSLog:
import os.log
...
os_log("[TAG] %{public}s", log: OSLog.default, type: type, String(describing: msg))
After I download logs from the phone using log collect on my mac, I can see, that only logs made while phone was unlocked are persisted. If I filter logs for my process, I can see that something is going on, as a lot of other logs from my process are saved (like the ones with categories tcp, connection, boringssl, etc.), but not my custom logs made with os_log. My logs appear only around the time I unlock the phone.
Is it expected behaviour? Can I make it log all the time without exceptions?