5

What are the commands for adding the MAMP Apache, PHP and MySQL error logs to the MacOSX Console?

Thanks!

jerome
  • 4,809
  • 13
  • 53
  • 70

3 Answers3

5

Similar to this question...

Console has a few standard locations where it will look for and index log files. The easiest thing you can do is add a symbolic link from the MAMP log files into one of the directories Console already uses, like ~/Library/Logs.

For example, my MAMP log files are located in /Applications/MAMP/logs. So I did:

cd ~/Library/Logs
ln -s /Applications/MAMP/logs/php_error.log .
ln -s /Applications/MAMP/logs/apache_access_log .

Hope that helps!

Community
  • 1
  • 1
fitzgeraldsteele
  • 4,547
  • 3
  • 24
  • 25
  • 3
    Or simply `ln -s /Applications/MAMP/logs/ ~/Library/Logs/MAMP`. And folder named `MAMP` will apprears in `~/Library/Logs` contains all MAMP's logs – mems Feb 28 '13 at 14:35
  • I really don't like mingling my logs files with the other logs in `/Library/Logs` or `~/Library/Logs`, so I prefer to put them in a folder. Also, `ln` can use wildcards... see my solution below. @mems: Adding a symlink to a folder no longer works, at least not in El Capitan. It used to, but now you just end up with a folder entry in the left quick-access bar and no contents. See my solution below for a better approach. – jrypkahauer Aug 31 '16 at 19:07
2

Do you mean Console.app? If so, click File/Open. If MAMP's logs are in a location that's not shown in the standard "open file" dialog, use Cmd-Shift-G to open a text field you can type the path into.

Console should remember the log files, so you can simply click them on the list at the left the next time you run it.

Sherm Pendley
  • 13,556
  • 3
  • 45
  • 57
  • Thanks! The other part of the problem is locating the three error files in MAMP. – jerome Mar 23 '11 at 15:59
  • This works, but it leaves you with one window per log file, and if you happen to close one you have to go manually re-open it... this isn't really a desirable approach. – jrypkahauer Aug 31 '16 at 19:07
0

It looks like they changed the behavior in the console app!! It used to be that you could just throw a symlink to a directory and the contents would show up in Console, but:

On El Capitan, Console doesn't follow symlinks to directories full of log files, it shows the directory but not the contents... so I have found it works really well to do this:

cd ~/Library/Logs
mkdir MyNewLogsFolder
cd MyNewLogsFolder
ln -s /path/to/logs/folder/*.log .

That will create a new entry in the left-side quick-access bar in Console and fill it with symlinks to the log files in your original logs directory.

It's quick and easy and works consistently across all versions of OS X.

jrypkahauer
  • 538
  • 5
  • 8