logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: How to redirect console output to logs and/or file
Author
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 04 Jun '08 21:20    Post subject: How to redirect console output to logs and/or file Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 05 Jun '08 11:42    Post subject: Reply with quote

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

PostPosted: Thu 05 Jun '08 15:13    Post subject: Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 05 Jun '08 16:11    Post subject: Reply with quote

Ah! Thanks, that works.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 05 Jun '08 16:46    Post subject: Reply with quote

I knew someone here would have the answer, thanks Tom.
Back to top


Reply to topic   Topic: How to redirect console output to logs and/or file View previous topic :: View next topic
Post new topic   Forum Index -> Apache