Re: log4j and tomcat 5.5

2004-12-16 Thread Steven J. Owens

On Thu, Dec 09, 2004 at 04:33:33PM -0600, Jacob Kjome wrote:
 For your own app, do you use actually use the commons-logging api or
 just the Log4j api?  If the latter, don't bother with
 commons-logging.  In fact, try to avoid it like the plague.

 Could you expand on this?  I've wondered in the past about this
very question (whether I should code my app to use commons-logging for
logging, or directly use log4j) and I'm interested in hearing what the
downsides are.

 I've said it before, I'll say it again, I wish there was some
sort of tomcat production hosting best practices repository.  Maybe
a wiki page or something.  Or maybe I'll just invite people to send me
suggestions for such a page.

-- 
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: log4j and tomcat 5.5

2004-12-16 Thread Jacob Kjome
At 03:17 PM 12/16/2004 -0500, you wrote:

On Thu, Dec 09, 2004 at 04:33:33PM -0600, Jacob Kjome wrote:
 For your own app, do you use actually use the commons-logging api or
 just the Log4j api?  If the latter, don't bother with
 commons-logging.  In fact, try to avoid it like the plague.

 Could you expand on this?  I've wondered in the past about this
very question (whether I should code my app to use commons-logging for
logging, or directly use log4j) and I'm interested in hearing what the
downsides are.

This has been covered many times.  Here are some good references...
http://marc.theaimsgroup.com/?l=log4j-userm=102640868804904
http://marc.theaimsgroup.com/?l=log4j-userm=103864746403401w=2
http://www.qos.ch/logging/thinkAgain.jsp
Commons Logging was my fault
http://radio.weblogs.com/0122027/2003/08/15.html
 I've said it before, I'll say it again, I wish there was some
sort of tomcat production hosting best practices repository.  Maybe
a wiki page or something.  Or maybe I'll just invite people to send me
suggestions for such a page.

Try the docs or the apache wiki
http://wiki.apache.org/jakarta-tomcat/FrontPage
Jake
--
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: log4j and tomcat 5.5

2004-12-13 Thread Shapira, Yoav

Hi,

-Original Message-
From: Dale, Matt [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 12, 2004 5:22 PM
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5

 Hopefully I explained things better and piqued your curiosity about
repostiory
 selectors in Log4j-1.3 :-)

You certainly have mine ;)

shamelessPlug

Log4j 1.3 is in an alpha state right now, and its only testers appear to
be its committers.  It'd be useful to have someone who knows what he's
doing, but is not a log4j committer, like you, test it as well.  ;)

/shamelessPlug

Yoav Shapira http://www.yoavshapira.com





This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: log4j and tomcat 5.5

2004-12-13 Thread Dale, Matt
Hi,

Shameless plug accepted, is there somewhere I can download it or do I need to 
get it from CVS?

Ta
Matt

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 13 December 2004 14:02
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5



Hi,

-Original Message-
From: Dale, Matt [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 12, 2004 5:22 PM
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5

 Hopefully I explained things better and piqued your curiosity about
repostiory
 selectors in Log4j-1.3 :-)

You certainly have mine ;)

shamelessPlug

Log4j 1.3 is in an alpha state right now, and its only testers appear to
be its committers.  It'd be useful to have someone who knows what he's
doing, but is not a log4j committer, like you, test it as well.  ;)

/shamelessPlug

Yoav Shapira http://www.yoavshapira.com





This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Any opinions expressed in this E-mail may be those of the individual and not 
necessarily the company. This E-mail and any files transmitted with it are 
confidential and solely for the use of the intended recipient. If you are not 
the intended recipient or the person responsible for delivering to the intended 
recipient, be advised that you have received this E-mail in error and that any 
use or copying is strictly prohibited. If you have received this E-mail in 
error please notify the beCogent postmaster at [EMAIL PROTECTED]
Unless expressly stated, opinions in this email are those of the individual 
sender and not beCogent Ltd. You must take full responsibility for virus 
checking this email and any attachments.
Please note that the content of this email or any of its attachments may 
contain data that falls within the scope of the Data Protection Acts and that 
you must ensure that any handling or processing of such data by you is fully 
compliant with the terms and provisions of the Data Protection Act 1984 and 
1998.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: log4j and tomcat 5.5

2004-12-13 Thread Shapira, Yoav

Hi,

Shameless plug accepted, is there somewhere I can download it or do I
need
to get it from CVS?

The download page: http://logging.apache.org/site/binindex.html.

Yoav Shapira http://www.yoavshapira.com




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: log4j and tomcat 5.5

2004-12-13 Thread Dale, Matt
ignore that, found the binary download.

Ta
Matt

-Original Message-
From: Dale, Matt 
Sent: 13 December 2004 14:37
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5


Hi,

Shameless plug accepted, is there somewhere I can download it or do I need to 
get it from CVS?

Ta
Matt

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 13 December 2004 14:02
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5



Hi,

-Original Message-
From: Dale, Matt [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 12, 2004 5:22 PM
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5

 Hopefully I explained things better and piqued your curiosity about
repostiory
 selectors in Log4j-1.3 :-)

You certainly have mine ;)

shamelessPlug

Log4j 1.3 is in an alpha state right now, and its only testers appear to
be its committers.  It'd be useful to have someone who knows what he's
doing, but is not a log4j committer, like you, test it as well.  ;)

/shamelessPlug

Yoav Shapira http://www.yoavshapira.com





This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Any opinions expressed in this E-mail may be those of the individual and not 
necessarily the company. This E-mail and any files transmitted with it are 
confidential and solely for the use of the intended recipient. If you are not 
the intended recipient or the person responsible for delivering to the intended 
recipient, be advised that you have received this E-mail in error and that any 
use or copying is strictly prohibited. If you have received this E-mail in 
error please notify the beCogent postmaster at [EMAIL PROTECTED]
Unless expressly stated, opinions in this email are those of the individual 
sender and not beCogent Ltd. You must take full responsibility for virus 
checking this email and any attachments.
Please note that the content of this email or any of its attachments may 
contain data that falls within the scope of the Data Protection Acts and that 
you must ensure that any handling or processing of such data by you is fully 
compliant with the terms and provisions of the Data Protection Act 1984 and 
1998.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: log4j and tomcat 5.5

2004-12-12 Thread Dale, Matt
 Hopefully I explained things better and piqued your curiosity about repostiory
 selectors in Log4j-1.3 :-)

You certainly have mine ;)

-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]
Sent: Friday, December 10, 2004 12:06 AM
To: Tomcat Users List; Marcelo Moreira
Subject: Re: log4j and tomcat 5.5


Quoting Marcelo Moreira [EMAIL PROTECTED]:

 On Thu,  9 Dec 2004 16:33:33 -0600, Jacob Kjome [EMAIL PROTECTED] wrote:
  Are you trying to enable logging for Tomcat, your webapp, or both?  You
 will
  need to add both log4j.jar and commons-logging.jar (not
  commons-logging-api.jar) to common/lib to enable Log4j logging for
 Tomcat-5.5.x
  itself.  For your own app, do you use actually use the commons-logging api
 or
  just the Log4j api?  If the latter, don't bother with commons-logging.  In
  fact, try to avoid it like the plague.  If you do require commons-logging
 for
  your webapp logging, I'm not entirely sure whether it is ok to have
 log4j.jar
  in WEB-INF/lib and commons-logging.jar in common/lib or if they have to be
  together.  There could be classloader issues if you separate them.  I'm not
  really sure.  commons-logging issus are outside the scope of my knowledge.

 Thanks for the answer. I am trying for both. commons-logging.jar +
 log4j.jar are in commons/lib. But here is the question: I do not see
 why they also have to be on the webapp WEB-INF/lib, since it should be
 shared because they are already on commons/lib.


If you share the common/lib instance of Log4j with your webapp, you will be
using the same logger repository as the application server.  There is one
configuration per logger repository.  If force reconfiguration within this
already configured logger repository, your old configuration will be blown
away.

The idea Putting another copy of Log4j.jar in WEB-INF/lib in addition to the one
in common/lib is to take advantage of Tomcat's classloading behavior which is
child first (recommended by the servlet spec) rather than parent first (normal
Java2 classloading behavior).  Because each webapp looks locally for libraries
first, it will find an instance of Log4j that is not in use by any other
application.  Therefore, the default logger repository will be distinct from
that of the server and from that of any other webapp.  You can configure to
your hearts content without stompting on others' logging configuration.

There is a way to separate application logging while sharing the same instance
of Log4j and that is by using a repository selector.  I would avoid this until
Log4j-1.3 is released.  It is more difficult to use a repository selector in
Log4j-1.2.  1.3 makes it very simple.  I recommend you use the first solution
until Log4j-1.3 is released.

 If I do not put them in the webapp WEB-INF/lib, logging for the webapp
 does not work.


You are counting on autoconfiguration here.  If you have an instance in
common/lib, but not one in WEB-INF/lib, the logger repository of the one in
common/lib will already have been configured by the time your app is
initialized.  Autoconfiguration is not performed more than once.  Your webapp,
in this case, will be using the configuration of the config file at the server
level (in common/classes).  Again, with a repository selector, your app config
could be separated from the default logger repository.  Note that in Log4j-1.3
you will need to perform configuration as there is no autoconfiguration, at
least via classloader discovery of config files, on non-default logger
repositories.

 As I said, I got it working already, but this is just curiosity.


Hopefully I explained things better and piqued your curiosity about repostiory
selectors in Log4j-1.3 :-)


Jake

 Thanks,
 Marcelo.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Any opinions expressed in this E-mail may be those of the individual and not 
necessarily the company. This E-mail and any files transmitted with it are 
confidential and solely for the use of the intended recipient. If you are not 
the intended recipient or the person responsible for delivering to the intended 
recipient, be advised that you have received this E-mail in error and that any 
use or copying is strictly prohibited. If you have received this E-mail in 
error please notify the beCogent postmaster at [EMAIL PROTECTED]
Unless expressly stated, opinions in this email are those of the individual 
sender and not beCogent Ltd. You must take full responsibility for virus 
checking this email and any attachments.
Please note that the content of this email or any of its attachments may 
contain data that falls within the scope of the Data Protection Acts and that 
you must ensure that any handling or processing

log4j and tomcat 5.5

2004-12-09 Thread Marcelo Moreira
Hello,

This is sure a newbie question, but I have been having a lot of
trouble trying to get logging to work on tomcat 5.5 with log4j.

I got everything working (I think...) but I have been wondering about
something...

Would anybody know why I still have to put a copy of
commons-logging.jar + log4j.jar into the webapp WEB-INF/lib directory
for logging to work for the webapp, even though it is already in
common/lib (so it should be shared by all classes, including webapps,
right...) ?

Thanks,
Marcelo.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: log4j and tomcat 5.5

2004-12-09 Thread Jacob Kjome

Are you trying to enable logging for Tomcat, your webapp, or both?  You will
need to add both log4j.jar and commons-logging.jar (not
commons-logging-api.jar) to common/lib to enable Log4j logging for Tomcat-5.5.x
itself.  For your own app, do you use actually use the commons-logging api or
just the Log4j api?  If the latter, don't bother with commons-logging.  In
fact, try to avoid it like the plague.  If you do require commons-logging for
your webapp logging, I'm not entirely sure whether it is ok to have log4j.jar
in WEB-INF/lib and commons-logging.jar in common/lib or if they have to be
together.  There could be classloader issues if you separate them.  I'm not
really sure.  commons-logging issus are outside the scope of my knowledge.


Jake

Quoting Marcelo Moreira [EMAIL PROTECTED]:

 Hello,

 This is sure a newbie question, but I have been having a lot of
 trouble trying to get logging to work on tomcat 5.5 with log4j.

 I got everything working (I think...) but I have been wondering about
 something...

 Would anybody know why I still have to put a copy of
 commons-logging.jar + log4j.jar into the webapp WEB-INF/lib directory
 for logging to work for the webapp, even though it is already in
 common/lib (so it should be shared by all classes, including webapps,
 right...) ?

 Thanks,
 Marcelo.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: log4j and tomcat 5.5

2004-12-09 Thread Marcelo Moreira
On Thu,  9 Dec 2004 16:33:33 -0600, Jacob Kjome [EMAIL PROTECTED] wrote:
 Are you trying to enable logging for Tomcat, your webapp, or both?  You will
 need to add both log4j.jar and commons-logging.jar (not
 commons-logging-api.jar) to common/lib to enable Log4j logging for 
 Tomcat-5.5.x
 itself.  For your own app, do you use actually use the commons-logging api or
 just the Log4j api?  If the latter, don't bother with commons-logging.  In
 fact, try to avoid it like the plague.  If you do require commons-logging for
 your webapp logging, I'm not entirely sure whether it is ok to have log4j.jar
 in WEB-INF/lib and commons-logging.jar in common/lib or if they have to be
 together.  There could be classloader issues if you separate them.  I'm not
 really sure.  commons-logging issus are outside the scope of my knowledge.

Thanks for the answer. I am trying for both. commons-logging.jar +
log4j.jar are in commons/lib. But here is the question: I do not see
why they also have to be on the webapp WEB-INF/lib, since it should be
shared because they are already on commons/lib.

If I do not put them in the webapp WEB-INF/lib, logging for the webapp
does not work.

As I said, I got it working already, but this is just curiosity.

Thanks,
Marcelo.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: log4j and tomcat 5.5

2004-12-09 Thread Jacob Kjome
Quoting Marcelo Moreira [EMAIL PROTECTED]:

 On Thu,  9 Dec 2004 16:33:33 -0600, Jacob Kjome [EMAIL PROTECTED] wrote:
  Are you trying to enable logging for Tomcat, your webapp, or both?  You
 will
  need to add both log4j.jar and commons-logging.jar (not
  commons-logging-api.jar) to common/lib to enable Log4j logging for
 Tomcat-5.5.x
  itself.  For your own app, do you use actually use the commons-logging api
 or
  just the Log4j api?  If the latter, don't bother with commons-logging.  In
  fact, try to avoid it like the plague.  If you do require commons-logging
 for
  your webapp logging, I'm not entirely sure whether it is ok to have
 log4j.jar
  in WEB-INF/lib and commons-logging.jar in common/lib or if they have to be
  together.  There could be classloader issues if you separate them.  I'm not
  really sure.  commons-logging issus are outside the scope of my knowledge.

 Thanks for the answer. I am trying for both. commons-logging.jar +
 log4j.jar are in commons/lib. But here is the question: I do not see
 why they also have to be on the webapp WEB-INF/lib, since it should be
 shared because they are already on commons/lib.


If you share the common/lib instance of Log4j with your webapp, you will be
using the same logger repository as the application server.  There is one
configuration per logger repository.  If force reconfiguration within this
already configured logger repository, your old configuration will be blown
away.

The idea Putting another copy of Log4j.jar in WEB-INF/lib in addition to the one
in common/lib is to take advantage of Tomcat's classloading behavior which is
child first (recommended by the servlet spec) rather than parent first (normal
Java2 classloading behavior).  Because each webapp looks locally for libraries
first, it will find an instance of Log4j that is not in use by any other
application.  Therefore, the default logger repository will be distinct from
that of the server and from that of any other webapp.  You can configure to
your hearts content without stompting on others' logging configuration.

There is a way to separate application logging while sharing the same instance
of Log4j and that is by using a repository selector.  I would avoid this until
Log4j-1.3 is released.  It is more difficult to use a repository selector in
Log4j-1.2.  1.3 makes it very simple.  I recommend you use the first solution
until Log4j-1.3 is released.

 If I do not put them in the webapp WEB-INF/lib, logging for the webapp
 does not work.


You are counting on autoconfiguration here.  If you have an instance in
common/lib, but not one in WEB-INF/lib, the logger repository of the one in
common/lib will already have been configured by the time your app is
initialized.  Autoconfiguration is not performed more than once.  Your webapp,
in this case, will be using the configuration of the config file at the server
level (in common/classes).  Again, with a repository selector, your app config
could be separated from the default logger repository.  Note that in Log4j-1.3
you will need to perform configuration as there is no autoconfiguration, at
least via classloader discovery of config files, on non-default logger
repositories.

 As I said, I got it working already, but this is just curiosity.


Hopefully I explained things better and piqued your curiosity about repostiory
selectors in Log4j-1.3 :-)


Jake

 Thanks,
 Marcelo.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to simply configure log4j in tomcat 5.5 ?

2004-09-23 Thread Remy Maucherat
On Wed, 22 Sep 2004 11:43:51 -0400, Tim Funk [EMAIL PROTECTED] wrote:
 I'm not sure of the exact syntax .. but try these combinations:
 
 http://marc.theaimsgroup.com/?l=tomcat-devm=108808958716712w=2

I've added the category names to the docs for each component (Context,
Host, etc), but we would need two things:
- a default configuration for Java logging
- a dedicated logging docs page (I'll put together something)

-- 
x
Rémy Maucherat
Developer  Consultant
JBoss Group (Europe) SàRL
x

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to simply configure log4j in tomcat 5.5 ?

2004-09-22 Thread Jean-Paul Le Fèvre
I'm currently experimenting the new features of Tomcat 5.5.2
and more precisely the logging facility.

I must confess that I'm really upset by this implementation based on log4j.

- Log4j is a *very* complex package, difficult to master. IMO it does not
  make sense to use such a library : logging is meant to *help* developpers
  and administrators and not to cause headaches.
  The first principle of logging should be KISS (keept it stupid simple)

- There is no good documentation on how to use and configure Log4j.
  The short guide by Gülcü is not useful. The complete guide is not free
  (à la JBoss).

- I've spent a lot of time browsing the FAQ, the Wikis, turning around
  many interconnected sites but without finding answers to my questions.

- There is only one (actually 2) document : the tips written by Geoff Mottram.

Well, having given my opinion I feel better ;)

More specifically here is my question :

How to define my log4j properties to obtain what I had with the old plain
Logger ?

Context path=/try docBase=try.war override=true swallowOutput=true
Logger className=org.apache.catalina.logger.FileLogger
directory=logs  prefix=try- suffix=.log
timestamp=true /
/Context

I've tried some variations of the following definitions but without success :

log4j.appender.L.File=/home/myself/soft/Tomcat/logs/try.log
log4j.logger.org.apache.catalina.core.ContainerBase.Catalina.localhost.try=INFO,L

(the last component the path is not very clear try or /try or something 
else)

Basically I do not really care about levels but I do want a file by context.

Sincerely,
-- 
___

Jean-Paul Le Fèvre  * Mail : [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to simply configure log4j in tomcat 5.5 ?

2004-09-22 Thread Shapira, Yoav

Hi,

Well, having given my opinion I feel better ;)

I'm glad you feel better ;)  I haven't disagreed more with an opinion in
a long time ;)

Check out http://jakarta.apache.org/tomcat/faq/logging.html.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to simply configure log4j in tomcat 5.5 ?

2004-09-22 Thread Tim Funk
I'm not sure of the exact syntax .. but try these combinations:
http://marc.theaimsgroup.com/?l=tomcat-devm=108808958716712w=2
-Tim
Jean-Paul Le Fèvre wrote:
I'm currently experimenting the new features of Tomcat 5.5.2
and more precisely the logging facility.
I must confess that I'm really upset by this implementation based on log4j.
- Log4j is a *very* complex package, difficult to master. IMO it does not
  make sense to use such a library : logging is meant to *help* developpers
  and administrators and not to cause headaches.
  The first principle of logging should be KISS (keept it stupid simple)
- There is no good documentation on how to use and configure Log4j.
  The short guide by Gülcü is not useful. The complete guide is not free
  (à la JBoss).
- I've spent a lot of time browsing the FAQ, the Wikis, turning around
  many interconnected sites but without finding answers to my questions.
- There is only one (actually 2) document : the tips written by Geoff Mottram.
Well, having given my opinion I feel better ;)
More specifically here is my question :
How to define my log4j properties to obtain what I had with the old plain
Logger ?
Context path=/try docBase=try.war override=true swallowOutput=true
Logger className=org.apache.catalina.logger.FileLogger
directory=logs  prefix=try- suffix=.log
timestamp=true /
/Context
I've tried some variations of the following definitions but without success :
log4j.appender.L.File=/home/myself/soft/Tomcat/logs/try.log
log4j.logger.org.apache.catalina.core.ContainerBase.Catalina.localhost.try=INFO,L
(the last component the path is not very clear try or /try or something 
else)

Basically I do not really care about levels but I do want a file by context.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


configure log4j in tomcat 5.5

2004-09-02 Thread animus1511
Hi all, 

I installed Tomcat 5.5 with compat-package for running under JDK 1.4.2 yesterday. I 
tried to configure tomcat and log4j. I use multiple services in my server.xml.

When I start tomcat it produces only logfiles for the windows service (stdout.log, 
stderr.log and jakarta_service_MMdd.log)

Here is the content of my two config-files:

Server port=2201 shutdown=SHUTDOWN

   Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
   Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/

   Service name=cma

  Connector enableLookups=false scheme=https secure=true
 URIEncoding=UTF-8 acceptCount=100 address=127.0.0.1
 compression=on port=9443 clientAuth=true
 keystoreFile=conf/cmakeystore keystorePass=IbrfdI
 truststoreFile=conf/cmakeystore truststorePass=IbrfdI/

  Engine defaultHost=cma.valdorian.de name=cmaengine

 Host appBase=webapps/cmawebapps autoDeploy=false 
   deployOnStartup=false name=cma.valdorian.de deployXML=false 
   unpackWARs=false workDir=work/cmaengine/cma.valdorian.de 
   errorReportValveClass=org.apache.catalina.valves.ErrorReportValve

Context cookies=false docBase=ROOT path= useNaming=false/

 /Host

  /Engine

   /Service

   Service name=cda


  Connector enableLookups=false scheme=https secure=true
 URIEncoding=UTF-8 acceptCount=100 address=127.0.0.1
 compression=on port=8443 keystoreFile=conf/cdakeystore
 keystorePass=IbrfdI/


  Connector enableLookups=false redirectPort=8443 scheme=http 
 secure=false URIEncoding=UTF-8 acceptCount=100
 address=127.0.0.1 compression=on port=8080/


  Engine defaultHost=www.valdorian.de name=cdaengine

 Host appBase=webapps/cdawebapps autoDeploy=false deployOnStartup=false
   name=www.valdorian.de deployXML=false unpackWARs=false
   errorReportValveClass=org.apache.catalina.valves.ErrorReportValve
   workDir=work/cdaengine/www.valdorian.de

Context cookies=false docBase=ROOT path= useNaming=false/

 /Host

  /Engine

   /Service


   Service name=prova


  Connector enableLookups=false scheme=https secure=true
 URIEncoding=UTF-8 acceptCount=100 address=127.0.0.1
 compression=on port=7443 keystoreFile=conf/provakeystore
 keystorePass=IbrfdI/


  Connector enableLookups=false redirectPort=7443 scheme=http 
 secure=false URIEncoding=UTF-8 acceptCount=100
 address=127.0.0.1 compression=on port=7070/


  Engine defaultHost=prova.avinci.de name=provaengine

 Host appBase=webapps/provawebapps autoDeploy=false 
deployOnStartup=false
   name=prova.avinci.de deployXML=false unpackWARs=false
   errorReportValveClass=org.apache.catalina.valves.ErrorReportValve
   workDir=work/provaengine/prova.avinci.de

Context docBase=ROOT path=/

 /Host

  /Engine

   /Service

/Server
==
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE log4j:configuration SYSTEM log4j.dtd

log4j:configuration  xmlns:log4j='http://jakarta.apache.org/log4j/'

   appender name=STDOUT class=org.apache.log4j.ConsoleAppender
  layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%d %-5p [%t] %c (%F:%L) - %m%n/
  /layout
   /appender

   appender name=cmaengine class=org.apache.log4j.DailyRollingFileAppender
  param name=File value=C:/Daten/Madura/Tomcat/logs/cmaengine.log /
  param name=DatePattern value='.'yyy-MM-dd /
  layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%-5p %d - %m%n/
  /layout
   /appender

   appender name=cdaengine class=org.apache.log4j.DailyRollingFileAppender
  param name=File value=C:/Daten/Madura/Tomcat/logs/cdaengine.log /
  param name=DatePattern value='.'yyy-MM-dd /
  layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%-5p %d - %m%n/
  /layout
   /appender

   appender name=provaengine class=org.apache.log4j.DailyRollingFileAppender
  param name=File value=C:/Daten/Madura/Tomcat/logs/provaengine.log /
  param name=DatePattern value='.'yyy-MM-dd /
  layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%-5p %d - %m%n/
  /layout
   /appender
   
   appender name=cma class=org.apache.log4j.DailyRollingFileAppender
  param name=File value=C:/Daten/Madura/Tomcat/logs/cma.log /
  param name=DatePattern value='.'yyy-MM-dd /
  layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%-5p %d - %m%n/
  /layout
   /appender

   appender name=cda class=org.apache.log4j.DailyRollingFileAppender