You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by H....@MI.unimaas.nl on 2003/12/17 00:32:43 UTC
How to customize logging?
Hi,
As a newbie to Cocoon I wonder how I can customize logging. I'd like to log
each "page" visited but stamped with timestamp, ip address and username,
preferably in a custom format.
I know how to do most of this using Log4J, but I haven't been able to figure
out how it works in Cocoon. I would also like to know how I can put all this
logging in one file, rather than looking in several files for the
information.
Thanks.
Bye, Helma
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: How to customize logging?
Posted by JD Daniels <jd...@datatrio.com>.
I simply added a source-write transformer to my pipelines....
<source:insert>
<source:source>module-files/stats/<util:time
format="yyyy/MM/dd"/>.xml</source:source>
<source:path>/log</source:path>
<source:fragment>
<statistic>
<date><util:time format="yyyy/MM/dd"/></date>
<time><util:time format="hh:mm:ss a"/></time>
<user-agent><xsp-request:get-header name="user-agent"/></user-agent>
<remote-addr><xsp-request:get-remote-address/></remote-addr>
<remote-host><xsp-request:get-remote-host/></remote-host>
<userFirstName><xsp-session:get-attribute
name="userFirstName"/></userFirstName>
<userLastName><xsp-session:get-attribute
name="userLastName"/></userLastName>
</statistic>
</source:fragment>
</source:insert>
This gives me a directory structure built from the time ie 2003/12/22.xml]
I then use the directory generator to make a view of this, and one simple
xsl to view the xml files.
JD
-----Original Message-----
From: H.vanderLinden@MI.unimaas.nl [mailto:H.vanderLinden@MI.unimaas.nl]
Sent: Tuesday, December 16, 2003 3:33 PM
To: users@cocoon.apache.org
Subject: How to customize logging?
Hi,
As a newbie to Cocoon I wonder how I can customize logging. I'd like to log
each "page" visited but stamped with timestamp, ip address and username,
preferably in a custom format.
I know how to do most of this using Log4J, but I haven't been able to figure
out how it works in Cocoon. I would also like to know how I can put all this
logging in one file, rather than looking in several files for the
information.
Thanks.
Bye, Helma
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org