DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Watch A Log And/or Search For A Certain Term

  • submit to reddit
        If you're developing on a server that has all PHP errors turned off, you can still watch the error log (if you have access to this file). For example on a dreamhost account you could try this:

tail -f /home/account/logs/
As the errors pour in, you will see them come by. Change 'account' to the username you have on dreamhost and to the domainname you host there. If the errors come in large amounts you can filter them by using grep:

tail -f /home/account/logs/ | grep -i "search_term"

Now only errors containing 'search_term' will be shown.