You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by maven apache <ap...@gmail.com> on 2010/12/25 05:37:44 UTC

how does the tomcat log generated? log4j?

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?

Re: how does the tomcat log generated? log4j?

Posted by maven apache <ap...@gmail.com>.
2010/12/26 Pid <pi...@pidster.com>

> On 25/12/2010 04:37, 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?
> >
>
> Dear Mr Maven Apache.
>
> Is that really your name?
>

Of course not. Just a web nickname. Since I like
maven<http://maven.apache.org/>,it
is the best build tool I have ever used.


>
>
> p
>

Re: how does the tomcat log generated? log4j?

Posted by Pid <pi...@pidster.com>.
On 25/12/2010 04:37, 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?
> 

Dear Mr Maven Apache.

Is that really your name?


p

Re: how does the tomcat log generated? log4j?

Posted by maven apache <ap...@gmail.com>.
Thanks,I will have a try.

2010/12/25 Konstantin Kolinko <kn...@gmail.com>

> 2010/12/25 maven apache <ap...@gmail.com>:
> > 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.
>
> You can use JDBCAccessLogValve
>
>
> http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/JDBCAccessLogValve.html
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: how does the tomcat log generated? log4j?

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/12/25 maven apache <ap...@gmail.com>:
> 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.

You can use JDBCAccessLogValve

http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/JDBCAccessLogValve.html

Best regards,
Konstantin Kolinko

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


RE: Change of email address

Posted by Martin Gainty <mg...@hotmail.com>.
contact info is now updated

Hope you had a good christmas!
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> From: m.mcquade@sympatico.ca
> To: users@tomcat.apache.org
> Subject: Change of email address
> Date: Sat, 25 Dec 2010 09:57:28 -0500
> 
> How does one go about changing to a new email address? A new address of
> m.mcquade@powergate.ca is in effect....
> 
> Thank-You and Merry christmas....
> Mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Change of email address

Posted by Michael McQuade <m....@sympatico.ca>.
How does one go about changing to a new email address?  A new address of
m.mcquade@powergate.ca is in effect....

Thank-You and Merry christmas....
Mike


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



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


Re: how does the tomcat log generated? log4j?

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/12/25 André Warnier <aw...@ice-sa.com>:
> The AccessLogValve documentation page does not say either that it uses
> log4j.

AccessLogValve (and ExtendedAccessLogValve) manage the log file by
themselves. They do not use logging framework in this sense.

Best regards,
Konstantin Kolinko

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


Re: how does the tomcat log generated? log4j?

Posted by maven apache <ap...@gmail.com>.
2010/12/26 André Warnier <aw...@ice-sa.com>

> maven apache wrote:
>
>> 2010/12/25 André Warnier <aw...@ice-sa.com>
>>
>>  The logging page which I pointed you to, does not say that Tomcat uses
>>> log4j.
>>> It says that you /can/ configure Tomcat to use log4j, instead of the
>>> default "juli" logging.  It even provides instructions to do so.
>>>
>>> The AccessLogValve documentation page does not say either that it uses
>>> log4j.
>>> But what it does say at the very beginning, is that the output file is
>>> changed every day at midnight.  So if you only read the files up to last
>>> night at midnight, you will never encounter the problem that something is
>>> still writing to it.
>>>
>>> Also, I do not know what your ultimate purpose is, but there exist
>>> already
>>> several open-source programs which read a logfile in the format produced
>>> by
>>> the Tomcat AccessLogValve, parse it, and produce nice graphical
>>> statistics
>>> out of it (like webalizer or awstats).  Maybe you are re-inventing
>>> something
>>> which already exists ?
>>>
>>>
>> Unfortunately yes,our boss want our own analyzer system based on java. :(
>>
>>
> Oh well, if the boss says so.
> But then I would /still/ recommend writing something in java which reads
> the above logfiles and feeds the database.  Seems a bit more reliable and
> more scaleable to me.
>

Thanks for your kind. I prefer to this manner also. And it is why I ask
problems in the stackover. :)

Of course,it is a java io question,not related to tomcat. :)




> What if the database is not available at some point for whatever reason ?
> You stop tomcat, or you lose the information ?
> In any case, you should look at the current access log files, and count the
> number of lines which it writes per second|minute|hour, and ask yourself if
> you want this number of transactions going into your database system in
> real-time.


Thanks for all your guys.


>
>
>
>
>
>
>>  Web access statistics are not usually something which needs to be
>>> accurate
>>> in real-time.
>>> Having Tomcat writing them directly to a database may have a noticeable
>>> impact on your applications performance. That's why this is something
>>> usually done off-line.
>>>
>>>  In fact,I just analyzer the logs before yesterday,it is also my boss who
>> require the real-time(almost) analysis .:)
>>
>> Thank you anyway,although having Tomcat writing logs directly to a
>> database
>> may cause performance problem,it is another way. My boss will decide it :)
>>
>>
>>
>>>
>>> maven apache wrote:
>>>
>>>  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 <aw...@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-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: how does the tomcat log generated? log4j?

Posted by André Warnier <aw...@ice-sa.com>.
maven apache wrote:
> 2010/12/25 André Warnier <aw...@ice-sa.com>
> 
>> The logging page which I pointed you to, does not say that Tomcat uses
>> log4j.
>> It says that you /can/ configure Tomcat to use log4j, instead of the
>> default "juli" logging.  It even provides instructions to do so.
>>
>> The AccessLogValve documentation page does not say either that it uses
>> log4j.
>> But what it does say at the very beginning, is that the output file is
>> changed every day at midnight.  So if you only read the files up to last
>> night at midnight, you will never encounter the problem that something is
>> still writing to it.
>>
>> Also, I do not know what your ultimate purpose is, but there exist already
>> several open-source programs which read a logfile in the format produced by
>> the Tomcat AccessLogValve, parse it, and produce nice graphical statistics
>> out of it (like webalizer or awstats).  Maybe you are re-inventing something
>> which already exists ?
>>
> 
> Unfortunately yes,our boss want our own analyzer system based on java. :(
>

Oh well, if the boss says so.
But then I would /still/ recommend writing something in java which reads the above 
logfiles and feeds the database.  Seems a bit more reliable and more scaleable to me.
What if the database is not available at some point for whatever reason ? You stop tomcat, 
or you lose the information ?
In any case, you should look at the current access log files, and count the number of 
lines which it writes per second|minute|hour, and ask yourself if you want this number of 
transactions going into your database system in real-time.




> 
>> Web access statistics are not usually something which needs to be accurate
>> in real-time.
>> Having Tomcat writing them directly to a database may have a noticeable
>> impact on your applications performance. That's why this is something
>> usually done off-line.
>>
> In fact,I just analyzer the logs before yesterday,it is also my boss who
> require the real-time(almost) analysis .:)
> 
> Thank you anyway,although having Tomcat writing logs directly to a database
> may cause performance problem,it is another way. My boss will decide it :)
> 
> 
>>
>>
>> maven apache wrote:
>>
>>> 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 <aw...@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-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


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


Re: how does the tomcat log generated? log4j?

Posted by maven apache <ap...@gmail.com>.
2010/12/25 André Warnier <aw...@ice-sa.com>

> The logging page which I pointed you to, does not say that Tomcat uses
> log4j.
> It says that you /can/ configure Tomcat to use log4j, instead of the
> default "juli" logging.  It even provides instructions to do so.
>
> The AccessLogValve documentation page does not say either that it uses
> log4j.
> But what it does say at the very beginning, is that the output file is
> changed every day at midnight.  So if you only read the files up to last
> night at midnight, you will never encounter the problem that something is
> still writing to it.
>
> Also, I do not know what your ultimate purpose is, but there exist already
> several open-source programs which read a logfile in the format produced by
> the Tomcat AccessLogValve, parse it, and produce nice graphical statistics
> out of it (like webalizer or awstats).  Maybe you are re-inventing something
> which already exists ?
>

Unfortunately yes,our boss want our own analyzer system based on java. :(


>
> Web access statistics are not usually something which needs to be accurate
> in real-time.
> Having Tomcat writing them directly to a database may have a noticeable
> impact on your applications performance. That's why this is something
> usually done off-line.
>
In fact,I just analyzer the logs before yesterday,it is also my boss who
require the real-time(almost) analysis .:)

Thank you anyway,although having Tomcat writing logs directly to a database
may cause performance problem,it is another way. My boss will decide it :)


>
>
>
> maven apache wrote:
>
>> 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 <aw...@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-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: how does the tomcat log generated? log4j?

Posted by André Warnier <aw...@ice-sa.com>.
The logging page which I pointed you to, does not say that Tomcat uses log4j.
It says that you /can/ configure Tomcat to use log4j, instead of the default "juli" 
logging.  It even provides instructions to do so.

The AccessLogValve documentation page does not say either that it uses log4j.
But what it does say at the very beginning, is that the output file is changed every day 
at midnight.  So if you only read the files up to last night at midnight, you will never 
encounter the problem that something is still writing to it.

Also, I do not know what your ultimate purpose is, but there exist already several 
open-source programs which read a logfile in the format produced by the Tomcat 
AccessLogValve, parse it, and produce nice graphical statistics out of it (like webalizer 
or awstats).  Maybe you are re-inventing something which already exists ?

Web access statistics are not usually something which needs to be accurate in real-time.
Having Tomcat writing them directly to a database may have a noticeable impact on your 
applications performance. That's why this is something usually done off-line.



maven apache wrote:
> 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 <aw...@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-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


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


Re: how does the tomcat log generated? log4j?

Posted by maven apache <ap...@gmail.com>.
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 <aw...@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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: how does the tomcat log generated? log4j?

Posted by André Warnier <aw...@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org