Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: How to redirect console output to logs and/or file |
|
Author |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 04 Jun '08 21:20 Post subject: How to redirect console output to logs and/or file |
|
|
I know this sounds dumb but I would like to be able to redirect my console output to a file or logs.
yes, I know C> command switches options > filename .. so simple, best way to get a printable quick reference of a apps /? output, however;
httpd -V > filename works, good and dandy, but
httpd [-h|-M|-S] > filename does not work, you get the output to the console and a empty file.
I haven't tested every single one, but
httpd -v > filename is it's own peculiar case, no output to console so you think it is working till you see the 0kb file produced.
I needed a list of all my hostnames in this thing for some late spring cleaning, had to do it the hard way by messing with the console settings so I could get things on one line and not to wrap that I could copy & paste to file. Pain!
If none worked I would consider this default behavior.
That some or at least one does and most don't, I would consider this a bug, one that seems to be in 1.3, 2.0 as well and possibly the stone age.
Suggestions? Would you consider it a bug?
off to clean
Gregg
Disclaimer: I have not tested with a Lounge package. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 05 Jun '08 11:42 Post subject: |
|
|
I tried with apachelounge dist and under debian linux. Same result. it must be something with the stdout. |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Thu 05 Jun '08 15:13 Post subject: |
|
|
Apache writes these things to stderr (2), not to stdout (1).
Try redirecting file descriptor 2 to a file, like this: Code: | httpd [-h|-M|-S] 2> filename |
-tom- |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 05 Jun '08 16:11 Post subject: |
|
|
Ah! Thanks, that works. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Thu 05 Jun '08 16:46 Post subject: |
|
|
I knew someone here would have the answer, thanks Tom. |
|
Back to top |
|
|
|
|
|
|