[Edu-sig] print to apache log from cgi script
Titu Kim
kimtitu@yahoo.com
Thu, 15 Nov 2001 17:22:45 -0800 (PST)
Thanks Schoen,
I am trying to find a mailing list such as web
programming related. If anybody knows one, please do
not hesitate to tell me.
Kim TItu
--- Seth David Schoen <schoen@loyalty.org> wrote:
> Titu Kim writes:
>
> > Hi,
> > How can i output some message apache log files
> so i
> > can see the progress in cgi script? If i use
> regular
> > print, cgi prints the content to client browser.
> >
> > Thanks for any suggestion.
>
> With many Unix web servers like Apache, writing data
> to standard error
> instead of standard output results in its being
> logged instead of
> transmitted to the client.
>
> You can write things to standard error by doing
> something like
>
> import sys
> #
> # ...
> #
> sys.stderr.write("hello there from my CGI
> script.\n")
>
> These errors are written _directly_ into the Apache
> error log for the
> appropriate virtual host, which means they will be
> intermingled with
> things like HTTP errors. That might not be what you
> want; it could be
> better to open your own log file from within your
> CGI script, using
> the "open" file, and write the data directly into
> your private log
> file instead.
>
> Questions about things like this might be more
> appropriate on some
> other list, although I'm not sure which one.
>
> --
> Seth David Schoen <schoen@loyalty.org> | Its really
> terrible when FBI arrested
> Temp. http://www.loyalty.org/~schoen/ | hacker, who
> visited USA with peacefull
> down: http://www.loyalty.org/ (CAF) | mission --
> to share his knowledge with
> http://www.freesklyarov.org/ | american
> nation. (Ilya V. Vasilyev)
>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com