Mac OS X 是否保存网络连接地址和日期/时间的日志?

Mac OS X 是否保存网络连接地址和日期/时间的日志?

我丢失了一份包含我上个月为某个客户工作时间的文件。

然而,我在为他们工作时始终连接到他们的无线网络。

有没有什么方法可以查看 OS X 中给定无线网络的连接开始时间、持续时间或断开连接时间的记录?

这样我就可以准确地向他们收费,而不是仅仅编造一个数字!

谢谢

皮特

答案1

检查各种日志/Applications/Utilities/Console.app

system.log看起来/private/var/log/kernel.log最好(后者被提及这里类似的问题)。只需搜索“en1”或任何你的网络接口(en0通常是有线、en1无线)。

然而,这些并没有说明网络的名称。但是如果你知道大概的时间(例如,检查你的电子邮件存档和版本控制软件),这可能会有很大帮助。

答案2

在 MacOS 10.11 上查看时/var/log,我发现了这个日志文件 wifi.log。以下搜索将为您提供有关 WiFi 状态变化的良好视角:

$ grep processAirPortStateChanges /var/log/wifi.log \
| grep connect \
| grep -v -e "old state=disconnected, new state=disconnected" \
-e "old state=connecting, new state=connecting" \
-e "old state=disconnected, new state=auto-join" \
-e "old state=auto-join, new state=connecting" \
| cut -d' ' -f1-5,12-

示例输出(是的,我的新康卡斯特路由器不太稳定,因此我在自己寻找日志文件时遇到了这个问题):

Sun Apr  3 00:46:08.540 old state=connecting, new state=4 bars
Sun Apr  3 01:46:50.509 old state=4 bars, new state=disconnected
Sun Apr  3 01:46:52.839 old state=4 bars, new state=connecting
Sun Apr  3 01:46:53.944 old state=connecting, new state=4 bars
Sun Apr  3 02:47:36.283 old state=4 bars, new state=disconnected
Sun Apr  3 02:47:37.900 old state=4 bars, new state=connecting
Sun Apr  3 02:47:38.385 old state=connecting, new state=4 bars
Sun Apr  3 03:49:38.732 old state=4 bars, new state=disconnected
Sun Apr  3 04:50:24.289 old state=4 bars, new state=disconnected
Sun Apr  3 04:50:26.313 old state=4 bars, new state=connecting
Sun Apr  3 04:50:27.026 old state=connecting, new state=4 bars
Sun Apr  3 05:51:10.288 old state=4 bars, new state=disconnected
Sun Apr  3 06:35:17.291 old state=4 bars, new state=disconnected
Sun Apr  3 06:35:19.983 old state=connecting, new state=4 bars
Sun Apr  3 08:18:36.758 old state=4 bars, new state=disconnected
Sun Apr  3 08:18:41.836 old state=4 bars, new state=connecting
Sun Apr  3 08:18:42.187 old state=connecting, new state=4 bars

相关内容