Welcome Guest, Not a member yet? Register   Sign In
tip for reading/managing CI logs on a Mac
#1

[eluser]Natebot[/eluser]
I've recently moved from developing on a Windows machine to a Mac, and wanted to share a quick tip for viewing and managing your local CI log files (maybe nothing special to you experience Mac users).

I am using the Console app to view my local Codeigniter log files. I found this tool better than just doing a 'tail -f' because I can delete files, set markers, and filter the log to only view the messages I am interested in.

While you can manually open your log file in Console with File > Open, the app itself doesn't allow you to save opened logs to its list of logs. However, you can get your entire CI log directory to appear in the Log List by creating a symbolic link to your CI log directory in ~/Library/Logs

In a shell type
Code:
ln -s /path/to/your/CI/logs ~/Library/Logs/CI_Logs

When you open the Console app you'll now see all your Codeigniter log files under LOG FILES > ~/Library/Logs > CI_Logs

You can also tail a remote log by following the example at http://www.macosxhints.com/article.php?q...7143735901 you can also follow your remote logs this way.

I created a simple shell script for this purpose that tails the current day's log and writes a local copy for the Console to display:
Code:
# /bin/sh
NOW=$(date +"%Y-%m-%d")
ssh mysite.com "tail -f /home/domain/system/logs/log-$NOW.php" >> ~/Library/Logs/CI_Remote_Logs/log-$NOW.log

I'm not a shell scripting expert and I'm sure someone could come up with something more robust - but being able to tail and filter the current log is fine with me. If I am analyzing old logs I just copy them over.




Theme © iAndrew 2016 - Forum software by © MyBB