Adding custom log locations to the OS X console application

There is one way to get your log files into the console.

You can add a symlink to the log file or log directory to one of the directories in the list. The directory ~/Library/Logs seems like the logical choice for adding your own log files.


For myself I wanted easy access to apache2 logs. I installed apache2 using macports and the default log file is located at /opt/local/apache2/logs.

Thus all I did was create the symlink to that directory.

# cd ~/Library/Logs
# ln -s /opt/local/apache2/logs/ apache2 

Now I can easily use the console.app to get to the logs.


My solution for macOS Sierra:

First and last step, you must create a hard link from your source (log) directory into (as example) one of existing official log directories, you can seen in console.app.

I take my ~/Library/Logs directory for that.

hln /usr/local/var/log /Users/dierk/Library/Logs/_usr_local_var_log

Cross-posting this great tool for creating hardlinks originally posted by Sam.

Short intro:

To install Hardlink, ensure you've installed homebrew, then run:

brew install hardlink-osx

Once installed, create a hard link with:

hln [source] [destination]


I actually just came across this option that worked perfectly for me:

Actually if you open terminal and...

$ cd /Library/Logs

then sym-link to your new log directory. eg i want my chroot'ed apache logs as 'www'

$ ln -s /chroot/apache/private/var/log www

then re-open Console.app

drill down into /Library/Logs and you will find your sym-linked directory.

;-)

Mohclips.

http://forums.macosxhints.com/showthread.php?t=35680


In Terminal run this command... append any log file directories you want to add

defaults write com.apple.Console LogFolderPaths -array '~/Library/Logs/' '/Library/Logs/' '/var/log/' '/opt/local/var/log/'