tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maven apache <>
Subject Re: how does the tomcat log generated? log4j?
Date Sat, 25 Dec 2010 11:54:19 GMT
Perhaps I’m not making myself clear,in fact I want to do some processing
work to the the logs created by the access log

For example:the log: - - [08/Dec/2010:08:44:43 +0800] "GET /poi.txt HTTP/1.1"
200 672 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv: Gecko/20100722 Firefox/3.6.8"

will be saved in the db in this format:

ip                  time                            method
uri               status    bytes      browser                  platform
------------------------------------------------------------------------------------------------------------------------------------------------------------ 2010-10-08 08:44:43  GET    /poi.txt    200    672
Firefox/3.6.8    winxp

And now I meet some problems when I read the log file like:

I read the file line by line,but sometime I can not get a complete line
since this file may be written in.

So,someone suggest me add a db appender(log4j),which will do the procesing
work and then export the log to db.


Now,from the link you give me ,it seems that tomcat does use log4j to create
its access log.

2010/12/25 André Warnier <>

> Hi.
> It is not very clear what you are asking, specially since you do not
> specify which version of Tomcat your are using, under which Java version and
> on which platform.
> Assuming you are using Tomcat 6.0.x, the on-line documentation for logging
> is here :
> Maybe read it first, and then come back if you have a specific question ?
> (But then try to specify the question clearly)
> maven apache wrote:
>> Hi:
>> I wonder how is the tomcat log generated,I mean the log like this;
>> localhost_access_log.2010-12-20.txt
>> I want to export the logs to db. Some one suggestion I directly add
>> one Appender <>
>> if tomcat also uses log4j to generate the logs and I have access to
>> the tomcat's log4j config file.
>> More details can be found in this post:
>> So I wonder if this is possible?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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