I'm doing infrequent development with Apache/PHP on my Windows machine so I've opted to run apache as a console process instead of a service. It would be nice if errors could be logged to the console window instead of a logfile so I can see them immediately. Can this be done somehow? It doesn't seem that apache has such a capability built in and I can't find a mod that would do this either.
views:
22answers:
2
+1
A:
I'm not sure if apache will let you do that, but have you tried using:
tail -f /the/apache/logfile.log
?
That should let you watch the log in realtime (assuming you aren't buffering it or anything)
EDIT:
Since this is a windows machine, the same thing can be done using TextPad (just have it to auto-reload the log file on change). It will function the same as tail
webdestroya
2010-04-27 23:33:06
It's a windows machine, I already stated that. But I suppose `tail` can be compiled for that too. Well, it's an option, although I'd prefer if there was just one console window. Hmm... then again I could probably get away with setting it up as a service and then creating a batch file to start it, followed by `tail` and then stopping the service. Or just write my own starter/reader/stopper program in C#, that's easy. Still - maybe a more elegant solution is available?
Vilx-
2010-04-27 23:44:28
I like this suggestion that way you have the errors in a file and displaying on the console. But yes, tail is native to *nix not Windows, though it can be made to work in Windows, easiest solution I know is cygwin
Flash84x
2010-04-28 00:01:39
Wow I totally glanced over the Windows part :(. I updated my answer to use TextPad, which should work
webdestroya
2010-04-28 00:09:18
@Flash84x - Actually a quick google search reveals quite a few native Win32 implementation of tail, including some by Microsoft itself. Cygwin is a bit extreme for my taste. :P
Vilx-
2010-04-28 00:21:09
@webdestroya - Interesting idea. I'm using Notepad++ myself, but that has this feature too.
Vilx-
2010-04-28 00:26:28
@Vilx - I generally found it as an annoyance, but it does have its uses.
webdestroya
2010-04-28 00:27:16
@webdestroya - as long as it can be set not to explicitly prompt every time there's an update, it should be fine. I might try it. :)
Vilx-
2010-04-28 00:34:01
@Vilx - "Prefs->File-> 'When files are open by another process... 'auto-reload'"
webdestroya
2010-04-28 01:32:34