mac os 查看系统日志_如何在Mac上查看系统日志

时间:2024-03-16 16:00:33
mac os 查看系统日志_如何在Mac上查看系统日志

mac os 查看系统日志

mac os 查看系统日志_如何在Mac上查看系统日志

Your Mac keeps system logs, which can help diagnose and troubleshoot problems with macOS and your installed applications. These logs are stored as plain-text log files on your Mac’s system drive, and macOS also includes an app for viewing them.

您的Mac会保留系统日志,这可以帮助诊断和排除macOS和已安装的应用程序的问题。 这些日志以纯文本日志文件的形式存储在Mac的系统驱动器上,而macOS还包括一个用于查看它们的应用程序。

在控制台应用程序中查看系统日志 (View System Logs in the Console App)

To view your Mac system logs, launch the Console app. You can launch it with Spotlight search by pressing Command+Space, typing “Console,” and then pressing Enter. You’ll also find it at Finder > Applications > Utilities > Console.

要查看Mac系统日志,请启动“控制台”应用程序。 您可以通过按Command + Space并键入“ Console”,然后按Enter来使用Spotlight搜索启动它。 您还将在Finder>应用程序>实用程序>控制台中找到它。

The Console app, also known as Console.app, is like a Windows Event Viewer for Mac.

Console应用程序,也称为Console.app,类似于Mac的Windows事件查看器

mac os 查看系统日志_如何在Mac上查看系统日志

By default, you’ll see a list of console messages from your current Mac. You can click “Errors and Faults” in the toolbar to see only error messages, if you like. You can also use the search box to search for a type of error message you want to see.

默认情况下,您会看到来自当前Mac的控制台消息列表。 如果愿意,您可以单击工具栏中的“错误和故障”以仅查看错误消息。 您还可以使用搜索框搜索您要查看的错误消息类型。

mac os 查看系统日志_如何在Mac上查看系统日志

More logs are available under Reports. To see application crash and freeze logs, click either “System Reports” for system applications or “User Reports” for user applications. You’ll see a variety of logs with file extensions like .crash, .diag, and .spin. Click them to view them in the Info pane.

报告下有更多日志。 要查看应用程序崩溃和冻结日志,请为系统应用程序单击“系统报告”或为用户应用程序单击“用户报告”。 您会看到各种带有文件扩展名的日志,例如.crash,.diag和.spin。 单击它们以在“信息”窗格中查看它们。

If you need more information about why an application crashes on your system, you may be able to find it here. An application’s developer may need this information to fix a crash that occurs on your Mac, too.

如果您需要有关应用程序为什么在系统上崩溃的更多信息,您可以在这里找到它。 应用程序的开发人员可能也需要此信息来修复Mac上发生的崩溃。

mac os 查看系统日志_如何在Mac上查看系统日志

To view the system log file, click “system.log.” To browse different application-specific logs, look through the other folders here. “~Library/Logs” is your current Mac user account’s user-specific application log folder, “/Library/Logs” is the system-wide application log folder, and “/var/log” generally contains logs for low-level system services. The search bar works to filter these log files, too.

要查看系统日志文件,请单击“ system.log”。 要浏览不同的特定于应用程序的日志,请在此处浏览其他文件夹。 “〜Library / Logs”是您当前Mac用户帐户的特定于用户的应用程序日志文件夹,“ / Library / Logs”是系统范围的应用程序日志文件夹,“ / var / log”通常包含用于低级系统服务的日志。 搜索栏也可以过滤这些日志文件。

To view another Mac user account’s logs located under “User Reports” or “~/Library/Logs,” you’ll have to sign in as that user and then open the Console app.

要查看位于“用户报告”或“〜/库/日志”下的另一个Mac用户帐户的日志,您必须以该用户身份登录,然后打开“控制台”应用程序。

mac os 查看系统日志_如何在Mac上查看系统日志

You can copy data from your system logs to a text file, if you need to export it to share it with someone else for troubleshooting purposes. First, click Edit > Select All to select all the messages on the current screen. Next, click Edit > Copy to copy them to your clipboard.

如果需要导出数据以便与其他人共享以进行故障排除,则可以将数据从系统日志复制到文本文件。 首先,单击编辑>全选以选择当前屏幕上的所有消息。 接下来,单击编辑>复制以将它们复制到剪贴板。

Next, open the TextEdit application—for example, by pressing Command+Space, typing “TextEdit,” and pressing “Enter.” Create a new document and then select Edit > Paste to paste the messages into the text file. Click File > Save to save your text file afterwards.

接下来,打开TextEdit应用程序,例如,通过按Command + Space,键入“ TextEdit”,然后按“ Enter”。 创建一个新文档,然后选择“编辑”>“粘贴”以将消息粘贴到文本文件中。 单击文件>保存以随后保存文本文件。

mac os 查看系统日志_如何在Mac上查看系统日志

在磁盘上查找日志文件 (Find Log Files on Disk)

These logs are plain-text files you can find on your Mac’s local disk, too. This means you can browse to them in Finder or via the Terminal, open them in other applications, use command-line tools with them, and back up the files.

这些日志是纯文本文件,您也可以在Mac的本地磁盘上找到这些日志。 这意味着您可以在Finder中或通过终端浏览到它们,在其他应用程序中打开它们,将命令行工具与它们一起使用,然后备份文件。

To find these log files, look in the following locations:

要查找这些日志文件,请查看以下位置:

  • System Log Folder: /var/log

    系统日志文件夹 :/ var / log

  • System Log: /var/log/system.log

    系统日志 :/var/log/system.log

  • Mac Analytics Data: /var/log/DiagnosticMessages

    Mac Analytics数据 :/ var / log / DiagnosticMessages

  • System Application Logs: /Library/Logs

    系统应用程序日志 :/ Library / Logs

  • System Reports: /Library/Logs/DiagnosticReports

    系统报告 :/ Library / Logs / DiagnosticReports

  • User Application Logs: ~/Library/Logs (in other words, /Users/NAME/Library/Logs)

    用户应用程序日志 :〜/ Library / Logs(换句话说,/ Users / NAME / Library / Logs)

  • User Reports: ~/Library/Logs/DiagnosticReports (in other words, /Users/NAME/Library/Logs/DiagnosticReports)

    用户报告 :〜/ Library / Logs / DiagnosticReports(换句话说,/ Users / NAME / Library / Logs / DiagnosticReports)

mac os 查看系统日志_如何在Mac上查看系统日志

If you ever need to remember where to find one of these folders, you can open the Console app (at /Applications/Utilities/Console.app), Ctrl+click or right-click one of the logs or folders in the sidebar, and select “Reveal in Finder” to view its location on disk.

如果您需要记住在哪里可以找到这些文件夹之一,则可以打开控制台应用程序(位于/Applications/Utilities/Console.app),按住Ctrl键单击或右键单击侧栏中的日志或文件夹之一,然后选择“在Finder中显示”以查看其在磁盘上的位置。

mac os 查看系统日志_如何在Mac上查看系统日志

翻译自: https://www.howtogeek.com/356942/how-to-view-the-system-log-on-a-mac/

mac os 查看系统日志