Custom log with htaccess

Custom log with htaccess

am 10.04.2007 13:06:34 von Dan Storm

Hi NG!

As far as I have understood, it's not possible to define a customlog or
logformat in htaccess? (I don't have access to the conf)

So, what I want to do now is to make a script handle every request and
make my script create the new log.

But how do I do that in htaccess?

Somewhat:

#comecode to start my script


Hope to get some help. :)

Re: Custom log with htaccess

am 10.04.2007 13:15:45 von unknown

Post removed (X-No-Archive: yes)

Re: Custom log with htaccess

am 10.04.2007 13:21:49 von Dan Storm

Davide Bianchi skrev:
> By defining a rewrite rule catch-all and redirect everything to your
> script... but this beg the question: why do you want so?

I want to do so, to make my Urchin track my SSL entries correctly. And
since it's easier for me, to make a new log file, then trying to create
a custom log format (because I don't understand the docs), I wanted to
make sure that all the requests was logged.

But if you have a better alternative, I'm all ears! :)

Re: Custom log with htaccess

am 10.04.2007 13:28:43 von Dan Storm

Dan Storm skrev:
> But if you have a better alternative, I'm all ears! :)

Might help if you have the details.
Urchin requires the logformat:

LogFormat "%h %v %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User−Agent}i\" \"%{Cookie}i\""

And the log entries outside my HTTPS protocol works with Urchin.

But when using HTTPS the entries is logged another way and when trying
to change the SSL log format the certifikate stalls and/or i can't
access the site securely.




Entry from ssl_log:
80.198.46.2 - - [10/Apr/2007:10:30:40 +0200] "GET
/__utm.gif?utmwv=6.1&utmn=1379502168&utmsr=1024x768&utmsc=32 -bit&utmul=da&utmje=1&utmjv=1.3&utmfl=8.0&utmdt=Indk%F8bskur v&utmhn=www.marstrands.com&utmp=/submit_gavekort
HTTP/1.1" 200 35

Entry from access_log:
80.63.33.34 - - [10/Apr/2007:11:55:14 +0200] "GET
/__utm.gif?utmwv=6.1&utmn=1073376464&utmsr=1024x768&utmsc=32 -bit&utmul=da&utmje=1&utmjv=1.3&utmfl=9.0&utmcn=1&utmdt=Mars trands.com%20-%20Bolig%2C%20mode%20og%20b%F8rnet%F8j&utmhn=w ww.marstrands.com&utmr=http://images.google.dk/imgres?imgurl =http://www.marstrands.com/filer/Billeder/Postmand_Per/58500 2_S.jpg&imgrefurl=http://www.marstrands.com/varekatalog.php% 3Fgrp%3D2&h=111&w=111&sz=8&hl=da&start=11&tbnid=loaRi1FqpmTz AM:&tbnh=86&tbnw=86&prev=/images%3Fq%3Dpostmand%2Bper%2Bbil% 26gbv%3D2%26ndsp%3D18%26svnum%3D10%26hl%3Dda%26sa%3DN&utmp=/ varekatalog.php?grp=2
HTTP/1.0" 200 35 "http://www.marstrands.com/varekatalog.php?grp=2"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
1.1.4322)" "-"

Re: Custom log with htaccess

am 10.04.2007 13:55:06 von unknown

Post removed (X-No-Archive: yes)

Re: Custom log with htaccess

am 10.04.2007 16:09:30 von Dan Storm

Davide Bianchi skrev:
> Ok, so this is up to the %b bit, it's missing the referer, user agent and
> cookie.
>
> I think that the idea of catching all the requests to a script and then
> creating a log file in there is going to be way to heavy for processing
> power to be viable. I'd request the hosting to change the log format
> or just use a different log analyzer. But of course is up to you.

The solution was to let Apache make another logfile for the virtualhost
that was running the SSL.

Thanks :)