Real time PHP error log monitoring with the PowerShell ISE

by Klaus Graefensteiner 24. October 2010 22:37

Introduction

Who would have guessed that PowerShell would come handy when developing PHP with Eclipse on Windows running against IIS7? But it’s a fact. There is this great one-liner for “tailing” any text file output in real time to the PowerShell console window or in my case the PowerShell ISE (Integrated Scripting Environment). PowerShell and the PowerShell_ISE are installed by default on any Windows 7 or Windows 2008 R2 machine and can be downloaded for older  Windows operating systems  from the Windows Management Framework web site.

image

Figure 1: Tailing the c:\windows\temp\php-errors.log file to the PowerShell ISE output window

One-Liner

Here is the very simple command that can save you some repetitive file opening time:

get-content C:\Windows\temp\php-errors.log -wait

Note: Depending on your php.ini settings the PHP error log file could be located somewhere else.

Movie

The following screencast shows the productivity improvement in action:

Ausblick

The Php error log is one of the text logs that I need to look at frequently. The other one is the VantagePoint EMI error log. In the next blog post I will extend this useful feature by demonstrating how easy it is to remotely monitor error log files using PowerShell Remoting.

Tags: , , , , , , , ,

PowerShell | Debugging | Php

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as Developer In Test and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Open Source Projects

PSUnit is a Unit Testing framwork for PowerShell. It is designed for simplicity and hosted by Codeplex.
BlogShell is The tool for lazy developers who like to automate the composition of blog content during the writing of a blog post. It is hosted by CodePlex.

Administration

About

Powered by:
BlogEngine.Net
Version: 1.6.1.0

License:
Creative Commons License

Copyright:
© Copyright 2013, Klaus Graefensteiner.

Disclaimer:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design:
This blog theme was designed and is copyrighted 2013 by Klaus Graefensteiner

Rendertime:
Page rendered at 5/21/2013 3:38:11 PM (PST Pacific Standard Time UTC DST -7)