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.
Yes it can.
Edit your httpd.conf
file to pipe the output of the error log to your console window with this directive:
ErrorLog "|more"
Just wanted to update this question with an answer that may be plaguing a bunch of people.
Scenario:
docker run <container_id>
to show logsWithout talking too much about docker, the relevant command I ran to run apache and show logs at the same time:
/usr/sbin/apache2 & tail -f /var/log/apache2/*
You can modify this as you need (I am using debian:jessie
image). As mentioned in a comment above, you have get tail
for windows and I believe the &
operator should work in Windows as well (not sure about this).
This command will block your shell and keep sprouting stuff from your logs...
Hope this helps someone
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With