You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Tony Collen <tc...@hist.umn.edu> on 2002/10/30 20:02:50 UTC

Question about logging

Hi everyone,

I'm toying around with the idea of writing something like a
ReferringURLGenerator that will spit out all the referring URLS that
Cocoon has seen in it's logs.  The only problem is that I can't find any
trace of such info being logged in access.log, core.log, sitemap.log, etc.
I notice in core.log, the following info is given for a request:

<snip>

REQUEST: /cocoon/documents/images/label-background_b.gif

CONTEXT PATH: /cocoon
SERVLET PATH: /documents/images/label-background_b.gif
PATH INFO: null

REMOTE HOST: localhost
REMOTE ADDRESS: 127.0.0.1
REMOTE USER: null
REQUEST SESSION ID: null
REQUEST PREFERRED LOCALE: en_US
SERVER HOST: localhost
SERVER PORT: 8080

METHOD: GET
CONTENT LENGTH: -1
PROTOCOL: HTTP/1.1
SCHEME: http
AUTH TYPE: null

CURRENT ACTIVE REQUESTS: 1
REQUEST PARAMETERS:

HEADER PARAMETERS:

PARAM: 'host' VALUES: '[localhost:8080]'
PARAM: 'user-agent' VALUES: '[Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1]'
PARAM: 'accept' VALUES:
'[text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1]'
PARAM: 'accept-encoding' VALUES: '[gzip, deflate, compress;q=0.9]'
PARAM: 'accept-charset' VALUES: '[ISO-8859-1, utf-8;q=0.66, *;q=0.66]'
PARAM: 'keep-alive' VALUES: '[300]'
PARAM: 'connection' VALUES: '[keep-alive]'
PARAM: 'cache-control' VALUES: '[max-age=0]'

</snip>

So, for a request of "/cocoon/documents/images/label-background_b.gif",
the referring URL should be "/cocoon/documents/index.html" .. Am I looking
in the right place for referrer info, or am I way off?


Tony



Tony Collen -- tc@socsci.umn.edu
College of Liberal Arts   University of Minnesota, Minneapolis, West Bank


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Ugo Cei <u....@cbim.it>.
Steven Noels wrote:
> Ugo Cei wrote:
> 
>  > Sorry for the OT question, but is it possible to have Tomcat 4.1 log
>  >  requests in the NCSA (combined) format, like Apache does? I'm going
>  > to move some sites from Apache+Tomcat to Tomcat standalone and I'd
>  > hate to lose statistics.
> 
> It seems so: 
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html#Access%20Log%20Valve 
> 
> 
> No canned recipe however.
> 
> </Steven>

No need for a canned recipe, I just had to fire up the admin interface, 
select the context, create a new valve and all the fields were already 
populated with reasonable default values. Just had to change the log 
format from "common" to "combined", save, commit and it just works. 
Beautiful!

Thanks and sorry for the OT, again.

	Ugo

-- 
Ugo Cei - http://www.beblogging.com/blog/


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Steven Noels <st...@outerthought.org>.
Ugo Cei wrote:

 > Sorry for the OT question, but is it possible to have Tomcat 4.1 log
 >  requests in the NCSA (combined) format, like Apache does? I'm going
 > to move some sites from Apache+Tomcat to Tomcat standalone and I'd
 > hate to lose statistics.

It seems so: 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html#Access%20Log%20Valve

No canned recipe however.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org                      stevenn@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Ugo Cei <u....@cbim.it>.
Vadim Gritsenko wrote:

> Cocoon by itself do not write access log similar to log of the web 
> server, because cocoon does not tries to replace web server.
> 
> Vadim

Sorry for the OT question, but is it possible to have Tomcat 4.1 log 
requests in the NCSA (combined) format, like Apache does? I'm going to 
move some sites from Apache+Tomcat to Tomcat standalone and I'd hate to 
lose statistics.

	Ugo


-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Ugo Cei <u....@cbim.it>.
Tony Collen wrote:
> Well, in the case of something like a weblog (cocoblog), it's nice to be
> able to track and see who's been linking to your posts.  That's all...
> probably a lot more work that it's worth.  I was hoping on finding
> something that was not container-specific, but I suppose it is the concern
> of the servlet container to log requests and not of the servlet that is
> running.

I suppose you could write an action that examined the request parameters 
and updated the referrer list in (quasi-) real time. I fancied writing 
one such action some time ago, but never found the time.

	Ugo

-- 
Ugo Cei - http://www.beblogging.com/blog/


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Tony Collen <tc...@hist.umn.edu>.
On Wed, 30 Oct 2002, Vadim Gritsenko wrote:

> >On a side note, it would be nice to have some sort of simple access logs
> >that followed the "tradition" Apache HTTPD-style logs.
> >
>
> But, as I said above, Tomcat can write it - why do you want to do it again?
>
> Vadim


Well, in the case of something like a weblog (cocoblog), it's nice to be
able to track and see who's been linking to your posts.  That's all...
probably a lot more work that it's worth.  I was hoping on finding
something that was not container-specific, but I suppose it is the concern
of the servlet container to log requests and not of the servlet that is
running.


Tony


Tony Collen -- tc@socsci.umn.edu
College of Liberal Arts   University of Minnesota, Minneapolis, West Bank


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Vadim Gritsenko <va...@verizon.net>.
Tony Collen wrote:

>On Wed, 30 Oct 2002, Vadim Gritsenko wrote:
>
>  
>
>>Where do you see it?
>>
>>
>>    
>>
>>>.. Am I looking
>>>in the right place for referrer info, or am I way off?
>>>
>>>      
>>>
>>You need referer header which browser sents. Usually this info logged by
>>web server or server engine. You can either create your own log (action
>>logging value of the header) or use existing log of the web server or
>>servlet engine.
>>
>>Cocoon by itself do not write access log similar to log of the web
>>server, because cocoon does not tries to replace web server.
>>    
>>
>
>Vadim,
>
>I eventually tracked down that the referring URL *is* given in core.log,
>but only when the log level is set to debug in logkit.xconf.  The thing
>that threw me off in this example was that for some reason the referrer
>was simply not being sent.  I tested this by tailing the log and reloading
>a few times and noticed that the referrer was being sent.
>
>I poked around with my ideas of somehow pulling out the referring URL, and
>started looking at writing a ReferringURLAction.  Off list, I emailed
>Christian Haul regarding some ideas, and he pointed out to me that there's
>the request InputModule which can let me access the referring url (or any
>header) by name.   I guess it's time to add docs to the Wiki...
>
>On a side note, it would be nice to have some sort of simple access logs
>that followed the "tradition" Apache HTTPD-style logs.
>

But, as I said above, Tomcat can write it - why do you want to do it again?

Vadim


>So much time, so little documentation, I guess :)
>
>Thanks for your help,
>
>
>Tony
>
>
>Tony Collen -- tc@socsci.umn.edu
>College of Liberal Arts   University of Minnesota, Minneapolis, West Bank
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Tony Collen <tc...@hist.umn.edu>.
On Wed, 30 Oct 2002, Vadim Gritsenko wrote:

> Where do you see it?
>
>
> > .. Am I looking
> >in the right place for referrer info, or am I way off?
> >
>
> You need referer header which browser sents. Usually this info logged by
> web server or server engine. You can either create your own log (action
> logging value of the header) or use existing log of the web server or
> servlet engine.
>
> Cocoon by itself do not write access log similar to log of the web
> server, because cocoon does not tries to replace web server.

Vadim,

I eventually tracked down that the referring URL *is* given in core.log,
but only when the log level is set to debug in logkit.xconf.  The thing
that threw me off in this example was that for some reason the referrer
was simply not being sent.  I tested this by tailing the log and reloading
a few times and noticed that the referrer was being sent.

I poked around with my ideas of somehow pulling out the referring URL, and
started looking at writing a ReferringURLAction.  Off list, I emailed
Christian Haul regarding some ideas, and he pointed out to me that there's
the request InputModule which can let me access the referring url (or any
header) by name.   I guess it's time to add docs to the Wiki...

On a side note, it would be nice to have some sort of simple access logs
that followed the "tradition" Apache HTTPD-style logs.

So much time, so little documentation, I guess :)

Thanks for your help,


Tony


Tony Collen -- tc@socsci.umn.edu
College of Liberal Arts   University of Minnesota, Minneapolis, West Bank


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Question about logging

Posted by Vadim Gritsenko <va...@verizon.net>.
Tony Collen wrote:

>Hi everyone,
>
>I'm toying around with the idea of writing something like a
>ReferringURLGenerator that will spit out all the referring URLS that
>Cocoon has seen in it's logs.  The only problem is that I can't find any
>trace of such info being logged in access.log, core.log, sitemap.log, etc.
>I notice in core.log, the following info is given for a request:
>
><snip>
>
>REQUEST: /cocoon/documents/images/label-background_b.gif
>
>CONTEXT PATH: /cocoon
>SERVLET PATH: /documents/images/label-background_b.gif
>PATH INFO: null
>
>REMOTE HOST: localhost
>REMOTE ADDRESS: 127.0.0.1
>REMOTE USER: null
>REQUEST SESSION ID: null
>REQUEST PREFERRED LOCALE: en_US
>SERVER HOST: localhost
>SERVER PORT: 8080
>
>METHOD: GET
>CONTENT LENGTH: -1
>PROTOCOL: HTTP/1.1
>SCHEME: http
>AUTH TYPE: null
>
>CURRENT ACTIVE REQUESTS: 1
>REQUEST PARAMETERS:
>
>HEADER PARAMETERS:
>
>PARAM: 'host' VALUES: '[localhost:8080]'
>PARAM: 'user-agent' VALUES: '[Mozilla/5.0 (X11; U; Linux i686; en-US;
>rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1]'
>PARAM: 'accept' VALUES:
>'[text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1]'
>PARAM: 'accept-encoding' VALUES: '[gzip, deflate, compress;q=0.9]'
>PARAM: 'accept-charset' VALUES: '[ISO-8859-1, utf-8;q=0.66, *;q=0.66]'
>PARAM: 'keep-alive' VALUES: '[300]'
>PARAM: 'connection' VALUES: '[keep-alive]'
>PARAM: 'cache-control' VALUES: '[max-age=0]'
>
></snip>
>
>So, for a request of "/cocoon/documents/images/label-background_b.gif",
>the referring URL should be "/cocoon/documents/index.html"
>

Where do you see it?


> .. Am I looking
>in the right place for referrer info, or am I way off?
>

You need referer header which browser sents. Usually this info logged by 
web server or server engine. You can either create your own log (action 
logging value of the header) or use existing log of the web server or 
servlet engine.

Cocoon by itself do not write access log similar to log of the web 
server, because cocoon does not tries to replace web server.

Vadim



>Tony
>
>
>
>Tony Collen -- tc@socsci.umn.edu
>College of Liberal Arts   University of Minnesota, Minneapolis, West Bank
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org