3 Replies Latest reply: Apr 23, 2012 10:40 AM by iamsudo Branched to a new discussion.
iamsudo Level 1 Level 1 (0 points)

How can I display Console's 'All Messages' in command line?


MacBook Pro, Mac OS X (10.7.3)
  • 1. Re: Display Console's 'All Messages' in command line
    BobHarris Level 6 Level 6 (13,120 points)

    That is going to be a bit difficult, as the "All" means displaying the output from a bunch of different log files all at once.

     

    I guess if you use Console to find the actual log files, you could then do something like:

     

    for log in /var/log/system.log /var/log/secure.log /var/log/windowserver.log etc...
    do
        tail -f $log &
    done
    

     

    This should start separate 'tail' commands for each of the logs and run them in the background concurrently.  It might get jumbled up from time to time, but that is one way to approximate the Console All mode.

     

    I guess you could write your own script to poll the different logs and control how they are displayed.

  • 2. Re: Display Console's 'All Messages' in command line
    Linc Davis Level 10 Level 10 (117,995 points)

    syslog -C

  • 3. Re: Display Console's 'All Messages' in command line
    iamsudo Level 1 Level 1 (0 points)

    syslog -F '$Time $(Sender): $Message'

     

    Except for the time format it's pretty the same output.

     

    Now what I'm trying to accomplish is

     

    syslog -F '$Time [$(Level)] $(Sender)[$(PID)]: $Message' -w 60

     

    but $Time should be formatted as DD.MM HH:MM:SS and $Level in full.