Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading syslog output on a Mac

Tags:

macos

syslog

People also ask

How do you pull logs on a Mac?

In the Console app on your Mac, type a search phrase, then press Return. To search activities, click the Activities button in the toolbar (or use the Touch Bar). Log messages or activities that fit the search criteria appear in the Console window. You can further refine the results.

Does Mac use syslog?

The Syslog daemon (syslog) on macOS is configured through the /etc/syslog. conf configuration file. Follow the steps below to send all Syslog messages from an macOS machine to EventSentry. Open the file /etc/syslog.

How do I view terminal log on Mac?

Open the Console application (from the Utilities folder inside your Applications folder). It should open to All Messages, showing the log entries for everything that's happened recently on your Mac. If you've previously narrowed the Console results, show the Log List and select All Messages before proceeding.


/var/log/system.log

You can monitor it easily using tail -f /var/log/system.log

See also the "logger" (man logger) and "syslog" (man syslog).


You should probably use the Console.app to view logfiles. It's purdy.

Select your device on the left and filter messages on the right:

enter image description here


When in doubt, there's always man syslog.

You can find your messages in /var/log/syslog; my machine is set up out of the box to only include high level messages so you may need to have your settings.

You can also read the messages through syslog(1), or create a test message with a command like

$ syslog -s -l INFO "Hello, world."

use a severity of P ("panic") and you'll get an exciting message on your console immediately.


Maybe interesting to note: Apple was using a real syslogd in the past but meanwhile all of this has switched to ASL (Apple System Log). The syslog command is still available, but it will only access this one log. If you want to access all log messages of ASL across all log files configured, use the log command.

E.g. the following shows all log messages produced by Safari within the last two days (be patient, can take a while):

log show --predicate 'process == "Safari"' --last 2d

See man log for all the actions you can perform, all the parameters it knows and what attributes you can filter for.