redirect Apache logs to console stdout

Problems with the Windows version of XAMPP, questions, comments, and anything related.

redirect Apache logs to console stdout

Postby th1alb » 16. July 2009 05:14

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.
th1alb
 
Posts: 98
Joined: 31. August 2005 21:14

Re: redirect Apache logs to console stdout

Postby Nobbie » 16. July 2009 08:39

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
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: redirect Apache logs to console stdout

Postby th1alb » 16. July 2009 08:52

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:
th1alb
 
Posts: 98
Joined: 31. August 2005 21:14

Re: redirect Apache logs to console stdout

Postby Wiedmann » 16. July 2009 09:56

I would like to disable Apache logging to files and redirect them to console stdout.

Why?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: redirect Apache logs to console stdout

Postby th1alb » 16. July 2009 11:07

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.
th1alb
 
Posts: 98
Joined: 31. August 2005 21:14

Re: redirect Apache logs to console stdout

Postby Wiedmann » 16. July 2009 12:46

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.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 125 guests