Integrating the mac console to your remote machine

I often use console logging to debug when coding in PHP. I use the below command to do this :

tail -f /var/log/tpsite/php.log

The logs would keep showing up in the terminal, I would need to keep clearing the screen to view my logs more clearly. There is a better way to do this if you are using your mac.

This is through the console application.

From your terminal in your local machine, type this command:

ssh “tail -f /var/log/tpsite/php.log” | grep -e ‘DDDDDDDDDDDDDDD’ -e ‘darshan’ >> ~/Library/Logs/tp.log

Basically what your doing here is, routing your logging to the local file.

After you do this, open console, and then open this file. You will automatically get the logs and its much easier to search, clear and read the logging.

Leave a Reply

Your email address will not be published.