Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

View console log in Terminal Apps
Back in the day, prior to Leopard, there was a console.log file, which contains errors and messages for the current user's account. When Leopard came around, this file was removed, and the system-wide logging system (ASL) replaced it. Those messages are still recorded, but when you view logs in Console, you can't see them on their own.

I was doing some research today for an article, and wondered where that file went, and how one could view it, since the full system.log contains so many entries that it can be hard to wade through. I found a forum thread from 2008 which explains that you can see what used to be in console.log by running syslog -C in Terminal. You can also run this command to save these entries in a file, then view them in vim: syslog -C > /tmp/console.log; view /tmp/console.log. Or, if you simply want to save this information in a text file, you can do this: syslog -C > /Desktop/console.log.

While this isn't new, it's good to know, if you're looking through logs in Console in search of information.
    •    
  • Currently 3.29 / 5
  You rated: 2 / 5 (7 votes cast)
 
[35,922 views]  

View console log in Terminal | 13 comments | Create New Account
Click here to return to the 'View console log in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View console log in Terminal
Authored by: chabig on May 31, '12 07:45:30AM

I don't know why you would go to Terminal to do this. It's a lot easier to view it using the Console app. It has a full GUI--you can scroll around, search, and save.



[ Reply to This | # ]
View console log in Terminal
Authored by: jonas_jonas on May 31, '12 07:49:57AM

Remote access over ssh for example?

---
http://depage.net | bureau



[ Reply to This | # ]
View console log in Terminal
Authored by: kirkmc on May 31, '12 08:38:22AM

Because Console no longer offers this view. It lumps all messages together.

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]
View console log in Terminal
Authored by: jasonq on May 31, '12 10:50:20AM

Unless I'm missing the point of this hint, you can view individual logs - console.app just defaults to an 'All Messages' smart filter.



[ Reply to This | # ]
View console log in Terminal
Authored by: devlogic on May 31, '12 08:00:21AM
You could probably also (with a bit of manpage reading) re-establish the old console.log by adding an appropriate entry in /etc/syslog.conf
 
edit Although now that I've done some quick searching, it looks like that's easier said than done; lots of "how do I do this" but no "this is how I did it" articles.
Edited on May 31, '12 08:17:22AM by devlogic


[ Reply to This | # ]
View console log in Terminal
Authored by: jasonq on May 31, '12 10:48:12AM

Am I missing something?

tail /var/log/system.log



[ Reply to This | # ]
View console log in Terminal
Authored by: jantonc on May 31, '12 01:57:45PM

syslog -C | open -f

opens the syslog in TextEdit where you can view, search, etc.

Me, I usually pipe things like this

syslog -C | bbmore

where 'bbmore' is
alias bbmore='bbedit --clean --view-top --new-window -t '\''Unix output'\'''



[ Reply to This | # ]
Re: View console log in Terminal
Authored by: Uncle Asad on May 31, '12 04:58:59PM

What's different between this and the stock "Console Messages" query provided by Console.app (in the "Show Log List" sidebar)? That query certainly looked to me like the same thing as the old console.log file (and it looks like a prettier version of what syslog -C outputs).

Or have OS versions post-10.5 removed the "Console Messages" query and just left the "All Messages" one?

That said, syslog -C does look like a handy tip for ssh usage, where I have bemoaned the loss of the console.log file.



[ Reply to This | # ]
Re: View console log in Terminal
Authored by: kirkmc on Jun 01, '12 12:54:12AM

As I say in the hint, when Leopard came around, they removed that from Console.

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]
Re: View console log in Terminal
Authored by: Uncle Asad on Jun 01, '12 01:45:45PM

Sorry, looking back I see I wasn't clear.

I was talking about the "Console Messages" item that's present by default in the sidebar starting on 10.5, replacing the item for "console.log" (the file), which was removed on 10.5.

The "Console Messages" item most certainly is present on 10.5; it was introduced then, not removed then ;-) Has it been removed post-10.5, as my second paragraph asked?



[ Reply to This | # ]
View console log in Terminal
Authored by: Hopper262 on May 31, '12 10:12:53PM

I didn't have a "Console Messages" item in my log list on Lion, but I was able to re-create it by going to "File" > "New System Log Query..." and adding the condition:

[ Facility ] [ is equal to ] com.apple.console

That matches the behavior of "syslog -C", according to the syslog man page (and my own brief testing).



[ Reply to This | # ]
View console log in Terminal
Authored by: kirkmc on Jun 01, '12 01:00:30AM

Great find.

Interestingly, the Terminal output is more readable. For example, in mine right now:

May 31 23:39:11 Walden [0x0-0x1ee1ee].com.apple.Safari[4862] <Notice>: May 31 23:39:11 Walden.local WebProcess[4864] <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.
--- last message repeated 83 times ---
May 31 23:39:12 Walden [0x0-0x1ee1ee].com.apple.Safari[4862] <Notice>: May 31 23:39:12 Walden.local WebProcess[4864] <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.
--- last message repeated 19 times ---

Whereas Console shows each of the repetitions.

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]
View console log in Terminal
Authored by: ccstone on Jun 05, '12 09:55:29AM

Bring it straight into vim via:

:r ! syslog -C

-ccs



[ Reply to This | # ]