我需要调试一些有关用户登录的问题,但是新的统一日志中许多有趣的信息都被隐藏了,如下所示(缩短):
opendirectoryd[130]: [com.apple.opendirectoryd:session] queuing request - <private>
在某些较旧的 macOS 版本中,有一个可以启用私人数据记录的选项:
sudo log config --mode "private_data:on"
但是在 Catalina 上,这会导致:
log: Invalid Modes 'private_data:on'
那么,问题是:如何在 macOS Catalina 上启用私人数据日志记录?
答案1
如此处所述统一日志:如何启用私有数据您可以像这样创建并安装配置文件:
配置文件以启用(显示)私人数据
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PayloadContent</key> <array> <dict> <key>PayloadDisplayName</key> <string>ManagedClient logging</string> <key>PayloadEnabled</key> <true/> <key>PayloadIdentifier</key> <string>com.apple.logging.ManagedClient.1</string> <key>PayloadType</key> <string>com.apple.system.logging</string> <key>PayloadUUID</key> <string>ED5DE307-A5FC-434F-AD88-187677F02222</string> <key>PayloadVersion</key> <integer>1</integer> <key>System</key> <dict> <key>Enable-Private-Data</key> <true/> </dict> </dict> </array> <key>PayloadDescription</key> <string>Enable Unified Log Private Data logging</string> <key>PayloadDisplayName</key> <string>Enable Unified Log Private Data</string> <key>PayloadIdentifier</key> <string>C510208B-AD6E-4121-A945-E397B61CACCF</string> <key>PayloadRemovalDisallowed</key> <false/> <key>PayloadScope</key> <string>System</string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string>D30C25BD-E0C1-44C8-830A-964F27DAD4BA</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </plist>
将文件另存为您的个人资料名称.mobileconfig。如果您不需要签名或部署它,您可以双击它,它将.mobileconfig
自动添加到个人资料在系统偏好设置一旦您进行了身份验证。
监控解锁用户和组在系统偏好设置在 macOS Catalina 10.15.3 上(如链接文章中所建议),此命令给出以下结果:
sudo log stream --predicate '(subsystem == "com.apple.opendirectoryd") && (senderImagePath == "\/System\/Library\/OpenDirectory\/Modules\/PlistFile.bundle\/Contents\/MacOS\/PlistFile")'