You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Brudermann <tb...@edu.uni-klu.ac.at> on 2007/03/09 17:14:02 UTC

Tomcat: Writing Access-Log to Database-Table?

Hello,

I use Tomcat 5.x for a web application and i would like to write a 
access-log for certain filetypes (pdf, jsp, htm) into a database-table 
(not into a file).

I considered to write the access-log to a file first and then transfer 
it to the database. However, this solution is not satisficing, because i 
need the data immediately. If a user accesses a jsp-file, the 
application should know, which urls the user accessed before (e.g.: 
select url from logTable where cookie=...).

Logging via a writeToDataBase(*this_request*)-Method within the jsps 
wouldn't help, because i cannot log access on pdf- or htm-files in this way.

Is there a possibility to configure Tomcat in a way that it writes 
certain requests into a database (or are there any add-ons which could 
help)?

I'm quite a newbie in this area and since i couldn't find anything 
useful on the web i appreciate every kind of advice or idea.

best regards,
Thomas

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat: Writing Access-Log to Database-Table?

Posted by Thomas Brudermann <tb...@edu.uni-klu.ac.at>.
Thanks Peter, that works fine.
Best regards,
Thomas

P.S. for the Archive:
The tutorial can be found at
http://java.sun.com/products/servlet/Filters.html




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Tomcat: Writing Access-Log to Database-Table?

Posted by Pe...@wcenter.de.
Hello,

your best bet is probably to write/configure a filter, that checks each 
request and stores the desired ones. This gives you the additional 
fexlibility to store hints for subsequent processing in the session or 
request. There are tutorials for that on the sun website and (if I 
remember right) an example in the Tomcat package.

Regards,

Peter Henningsen
Senior Consultant