Re: how does the tomcat log generated? log4j?

2010-12-26 Thread maven apache
Thanks,I will have a try.

2010/12/25 Konstantin Kolinko knst.koli...@gmail.com

 2010/12/25 maven apache apachemav...@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-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: how does the tomcat log generated? log4j?

2010-12-26 Thread maven apache
2010/12/25 André Warnier a...@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  timemethod
 uri   statusbytes  browser  platform

 

 10.33.2.45 2010-10-08 08:44:43  GET/poi.txt200672
 Firefox/3.6.8winxp

 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





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




Re: how does the tomcat log generated? log4j?

2010-12-26 Thread maven apache
2010/12/26 Pid p...@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
mavenhttp://maven.apache.org/,it
is the best build tool I have ever used.




 p



Re: how does the tomcat log generated? log4j?

2010-12-26 Thread André Warnier

maven apache wrote:

2010/12/25 André Warnier a...@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  timemethod
uri   statusbytes  browser  platform



10.33.2.45 2010-10-08 08:44:43  GET/poi.txt200672
Firefox/3.6.8winxp

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




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







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



Re: how does the tomcat log generated? log4j?

2010-12-26 Thread maven apache
2010/12/26 André Warnier a...@ice-sa.com

 maven apache wrote:

 2010/12/25 André Warnier a...@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  timemethod
 uri   statusbytes  browser  platform


 

 10.33.2.45 2010-10-08 08:44:43  GET/poi.txt200672
 Firefox/3.6.8winxp

 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



  -
 To unsubscribe, e-mail: 

Re: how does the tomcat log generated? log4j?

2010-12-25 Thread 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 :

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



Re: how does the tomcat log generated? log4j?

2010-12-25 Thread maven apache
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
valvehttp://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valveto
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  timemethod
uri   statusbytes  browser  platform


10.33.2.45 2010-10-08 08:44:43  GET/poi.txt200672
Firefox/3.6.8winxp

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




Re: how does the tomcat log generated? log4j?

2010-12-25 Thread Konstantin Kolinko
2010/12/25 maven apache apachemav...@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
 valvehttp://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valveto
 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how does the tomcat log generated? log4j?

2010-12-25 Thread André Warnier

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
valvehttp://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valveto
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  timemethod
uri   statusbytes  browser  platform


10.33.2.45 2010-10-08 08:44:43  GET/poi.txt200672
Firefox/3.6.8winxp

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







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



Re: how does the tomcat log generated? log4j?

2010-12-25 Thread Konstantin Kolinko
2010/12/25 André Warnier a...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how does the tomcat log generated? log4j?

2010-12-25 Thread Pid
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


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


how does the tomcat log generated? log4j?

2010-12-24 Thread maven apache
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?