write to log

write to log

am 10.01.2008 18:28:23 von cmk128

Hi
is it possible to write something to the apache log?
thanks
from Peter (cmk128@hotmail.com)

Re: write to log

am 10.01.2008 19:01:12 von Luuk

schreef in bericht
news:9bd94281-dd5f-4262-95ed-b1c1352936a9@i29g2000prf.google groups.com...
> Hi
> is it possible to write something to the apache log?
> thanks
> from Peter (cmk128@hotmail.com)

sure, try:
system("wget http://localhost");

it will write something like the following line to the logfile:
127.0.0.1 - - [10/Jan/2008:18:59:44 +0100] "GET / HTTP/1.0" 200 90 "-"
"Wget/1.10.2"

;-)

Re: write to log

am 11.01.2008 13:25:51 von colin.mckinnon

On Jan 10, 5:28 pm, cmk...@hotmail.com wrote:
> Hi
> is it possible to write something to the apache log?
> thanks
> from Peter (cmk...@hotmail.com)

if you're running as a module (not sure about CGI/fasCGI) then
anything written to stderr appears in error_log. You can't write to
the access_log.

A better solution for logging is to use the syslog facility (via PHP's
syslog() fn)

C.

Re: write to log

am 11.01.2008 17:48:21 von cmk128

On 1月11日, 上午4時25分, "C. (http://symcbean.blogspot.com/)"
wrote:
> On Jan 10, 5:28 pm, cmk...@hotmail.com wrote:
>
> > Hi
> > is it possible to write something to the apache log?
> > thanks
> > from Peter (cmk...@hotmail.com)
>
> if you're running as a module (not sure about CGI/fasCGI) then
> anything written to stderr appears in error_log. You can't write to
> the access_log.
>
> A better solution for logging is to use the syslog facility (via PHP's
> syslog() fn)
>
> C.

Thanks mr c.

Re: write to log

am 15.01.2008 14:39:20 von Rob

On Jan 11, 4:48 pm, cmk...@hotmail.com wrote:
> On 1月11日, 上午4時25分, "C. (http://symcbean.blogspot.com/)"
>
>
>
>
>
> wrote:
> > On Jan 10, 5:28 pm, cmk...@hotmail.com wrote:
>
> > > Hi
> > > is it possible to write something to the apache log?
> > > thanks
> > > from Peter (cmk...@hotmail.com)
>
> > if you're running as a module (not sure about CGI/fasCGI) then
> > anything written to stderr appears in error_log. You can't write to
> > the access_log.
>
> > A better solution for logging is to use the syslog facility (via PHP's
> > syslog() fn)
>
> > C.
>
> Thanks mr c.- Hide quoted text -
>
> - Show quoted text -

Also see error_log() - http://uk2.php.net/manual/en/function.error-log.php