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
valve<http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve>to
database.

For example:the log:

10.33.2.45 - - [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:1.9.2.8) Gecko/20100722 Firefox/3.6.8"

will be saved in the db in this format:

ip                  time                            method
uri               status    bytes      browser                  platform
------------------------------------------------------------------------------------------------------------------------------------------------------------

10.33.2.45 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:
localhost_access_log.2010-12-20.txt

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 <a...@ice-sa.com>

> 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 :
>
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
>
> 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 <http://logging.apache.org/log4j/1.2/apidocs/index.html>
>>
>> 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:
>>
>> http://stackoverflow.com/questions/4486620/randomaccessfile-probelm
>>
>> So I wonder if this is possible?
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to