Page 1 of 1

redirect Apache logs to console stdout

PostPosted: 16. July 2009 05:14
by th1alb
I would like to disable Apache logging to files and redirect them to console stdout.

I've read the Apache documentation here:
http://httpd.apache.org/docs/1.3/logs.html#piped

It seems possible to redirect logs using pipes.
So i've modified "httpd.conf" like this:
Code: Select all
...
ErrorLog |more
...
CustomLog |more common
...


Some messages are now printed to stdout, but not the full logs.

Re: redirect Apache logs to console stdout

PostPosted: 16. July 2009 08:39
by Nobbie
th1alb wrote:Some messages are now printed to stdout, but not the full logs.


I think this is probably due to the "more" command, which buffers output page by page (awaiting any key for continuing). Try "cat" instead:

ErrorLog |cat

Re: redirect Apache logs to console stdout

PostPosted: 16. July 2009 08:52
by th1alb
I've tried with GnuWin32's cat, but i still get only a few lines from the log.
Then the server creates a child process, two empty console windows are opened, and no more log messages are printed.
:cry:

Re: redirect Apache logs to console stdout

PostPosted: 16. July 2009 09:56
by Wiedmann
I would like to disable Apache logging to files and redirect them to console stdout.

Why?

Re: redirect Apache logs to console stdout

PostPosted: 16. July 2009 11:07
by th1alb
Wiedmann wrote:
I would like to disable Apache logging to files and redirect them to console stdout.

Why?


Because XAMPP can be run from an USB pendrive, so disabling logging produces less writes to the flash memory.
2nd reason: this way i can easily monitor what is going on the server without the need to reload continuously log files.

Re: redirect Apache logs to console stdout

PostPosted: 16. July 2009 12:46
by Wiedmann
2nd reason: this way i can easily monitor what is going on the server without the need to reload continuously log files.

I'm using "tail" for this.