tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Laughton <jlaug...@cisco.com>
Subject RE: Server Access Log and Request Information
Date Fri, 21 Oct 2005 21:59:03 GMT
Or if you are using commons logging

<%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %>

.....

<%
Log log = LogFactory.getLog(yourJsp1Name.class);
log.info("this message was writed from yourJsp1Name.jsp");
%>

This way you will have all the record in one log file, but each can have 
its own identifier (depending on how you set up your "ConversionPattern" in 
the log4j.properties

John

At 11:38 PM 10/21/2005 +0200, Mauricio Fernandez A. wrote:
>TK,
>
>If i understand what you want, you can do something like this.
>
>you can define a logger for each page (I think you have jsp`s), that causes
>that every record on the log file has its logger name on the log file.
>
>example: (if you are using log4j)
>
>your jsp´s must be like this: (yourJspName = your jsp name, that is to makes
>every log has the jsp name in the log file )
>
><%@ page import="org.apache.log4j.Logger" %>
>
>...
>
>         Logger logger = Logger.getLogger(yourJsp1Name.class);
>         logger.info("this message was writed from yourJsp1Name.jsp");
>...
>
>
>and your log file will be like this:
>
>...
>2005-10-21 23:20:52,275 INFO  org.apache.jsp.jsp.yourJsp1Name_jsp - this
>message was writed from yourJsp1Name.jsp
>...
>
>I think this can help you identify which object are from which page but how
>to construct the table you want I think it is your problem analisys where
>you can find the answer.
>
>
>Mauricio Fernández A.
>Ingeniero de Sistemas
>U. Autónoma de Manizales
>
>-----Mensaje original-----
>De: TK [mailto:tkchiew@gmail.com]
>Enviado el: viernes, 21 octubre, 2005 20:44
>Para: tomcat-user@jakarta.apache.org
>Asunto: Server Access Log and Request Information
>
>
>Hi,
>I am looking for ways to associate each object recorded in the log file with
>the corresponding page requested. Say, for example,
>  Page A contains objects p, q, r, s
>Page B contains onjects x, y, z
>  Requests for pages A & B, and objects p, q, r, s, x, y & z will be recorded
>in log file.
>  How could I identify p, q, r, s are embedded objects for page A while x, y,
>z are embedded objects for page B?
>  By doing so, I hope I could construct a user - accessed pages/objects
>table.
>  Thanks in advance for any advice and comments.
>   Cheers,
>TK
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org

*****************************************
   John Laughton,            Cisco Systems
   (john.laughton@cisco.com)
   408.902.3592 (voicemail and fax)
   page - 1 800 365 4578
*****************************************

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message