RE: Commons-logging and JDK 1.4 Logger

2002-11-27 Thread Wendy Cameron
Fantastic, got it figured it all out

Thank you very much

 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 27, 2002 4:29 PM
 To: Struts Users Mailing List
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 
 
 On Wed, 27 Nov 2002, Wendy Cameron wrote:
 
  Date: Wed, 27 Nov 2002 15:09:19 +1000
  From: Wendy Cameron [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: RE: Commons-logging and JDK 1.4 Logger
 
  Well actually a few more stupid questions cause it doesnt 
 work yet :)
 
  I have created properties file with the following:
 
  
 org.apache.commons.logging.LogFactory=org.apache.commons.loggi
 ng.impl.Jdk14Logger
  
 org.apache.commons.logging.Log=org.apache.commons.logging.impl
 .Jdk14Logger
 
  Placed it in WEB-INF directory and I have a debug statement 
 in my code
 
  log.trace(init(  +  actions + ));
 
  in my j2re\lib directory if logging.properties
  java.util.logging.FileHandler.pattern = 
 C:\\inMotion\\logs\\java%u.log
 
 This just says where the log messages go -- not what should 
 be logged.  If
 your logger is named com.foo.MyClass, you'd need to add:
 
   com.foo.MyClass.level = FINEST
 
 or, if you wanted trace output from all the classes in the com.foo
 package:
 
   com.foo.level = FINEST
 
 For more information about configuring JDK logging, see the JDK
 Documentation Bundle -- it's got an article specifically 
 about the logging
 features.
 
 One other note -- the JDK logging properties are only read when a
 particular JVM first starts using the logging calls, so you'll need to
 restart Tomcat to make any changes take effect.
 
  Is this necessary or is this controlled by:
 
  Logger className=org.apache.catalina.logger.FileLogger
   prefix=localhost_image_base_log. 
 suffix=.txt
timestamp=true/
 
  in the context declaration in the server.xml?
 
 
 This is just the output from ServletContext.log() calls, not the
 commons-logging calls.
 
  any suggestions?
 
  Regards Wendy
 
 
 Craig
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-27 Thread Wendy Cameron
One more little thing, when i use the fine method for logging i get my error messages 
but it doesnt seem to matter what I set level to, I the isDebugEnabled message dont 
seem to get logged, any suggestions as to why?

And how I can get message is isDebugEnabled areas to display?

Regards Wendy

 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 27, 2002 4:29 PM
 To: Struts Users Mailing List
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 
 
 On Wed, 27 Nov 2002, Wendy Cameron wrote:
 
  Date: Wed, 27 Nov 2002 15:09:19 +1000
  From: Wendy Cameron [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: RE: Commons-logging and JDK 1.4 Logger
 
  Well actually a few more stupid questions cause it doesnt 
 work yet :)
 
  I have created properties file with the following:
 
  
 org.apache.commons.logging.LogFactory=org.apache.commons.loggi
 ng.impl.Jdk14Logger
  
 org.apache.commons.logging.Log=org.apache.commons.logging.impl
 .Jdk14Logger
 
  Placed it in WEB-INF directory and I have a debug statement 
 in my code
 
  log.trace(init(  +  actions + ));
 
  in my j2re\lib directory if logging.properties
  java.util.logging.FileHandler.pattern = 
 C:\\inMotion\\logs\\java%u.log
 
 This just says where the log messages go -- not what should 
 be logged.  If
 your logger is named com.foo.MyClass, you'd need to add:
 
   com.foo.MyClass.level = FINEST
 
 or, if you wanted trace output from all the classes in the com.foo
 package:
 
   com.foo.level = FINEST
 
 For more information about configuring JDK logging, see the JDK
 Documentation Bundle -- it's got an article specifically 
 about the logging
 features.
 
 One other note -- the JDK logging properties are only read when a
 particular JVM first starts using the logging calls, so you'll need to
 restart Tomcat to make any changes take effect.
 
  Is this necessary or is this controlled by:
 
  Logger className=org.apache.catalina.logger.FileLogger
   prefix=localhost_image_base_log. 
 suffix=.txt
timestamp=true/
 
  in the context declaration in the server.xml?
 
 
 This is just the output from ServletContext.log() calls, not the
 commons-logging calls.
 
  any suggestions?
 
  Regards Wendy
 
 
 Craig
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-27 Thread Craig R. McClanahan


On Wed, 27 Nov 2002, Wendy Cameron wrote:

 Date: Wed, 27 Nov 2002 19:33:09 +1000
 From: Wendy Cameron [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: RE: Commons-logging and JDK 1.4 Logger

 One more little thing, when i use the fine method for logging i get my error 
messages but it doesnt seem to matter what I set level to, I the isDebugEnabled 
message dont seem to get logged, any suggestions as to why?

 And how I can get message is isDebugEnabled areas to display?


JDK 1.4 logging does have a wierd tweak if you're using the console
handler -- it has a global minimum level setting that is enforced, no
matter what the actual logger levels are configured for.  Change the
following setting to let your individual logging configuration always win:

java.util.logging.ConsoleHandler.level = INFO

 Regards Wendy


Craig


  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, November 27, 2002 4:29 PM
  To: Struts Users Mailing List
  Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 
 
  On Wed, 27 Nov 2002, Wendy Cameron wrote:
 
   Date: Wed, 27 Nov 2002 15:09:19 +1000
   From: Wendy Cameron [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
   To: Struts Users Mailing List [EMAIL PROTECTED]
   Subject: RE: Commons-logging and JDK 1.4 Logger
  
   Well actually a few more stupid questions cause it doesnt
  work yet :)
  
   I have created properties file with the following:
  
  
  org.apache.commons.logging.LogFactory=org.apache.commons.loggi
  ng.impl.Jdk14Logger
  
  org.apache.commons.logging.Log=org.apache.commons.logging.impl
  .Jdk14Logger
  
   Placed it in WEB-INF directory and I have a debug statement
  in my code
  
   log.trace(init(  +  actions + ));
  
   in my j2re\lib directory if logging.properties
   java.util.logging.FileHandler.pattern =
  C:\\inMotion\\logs\\java%u.log
 
  This just says where the log messages go -- not what should
  be logged.  If
  your logger is named com.foo.MyClass, you'd need to add:
 
com.foo.MyClass.level = FINEST
 
  or, if you wanted trace output from all the classes in the com.foo
  package:
 
com.foo.level = FINEST
 
  For more information about configuring JDK logging, see the JDK
  Documentation Bundle -- it's got an article specifically
  about the logging
  features.
 
  One other note -- the JDK logging properties are only read when a
  particular JVM first starts using the logging calls, so you'll need to
  restart Tomcat to make any changes take effect.
 
   Is this necessary or is this controlled by:
  
   Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_image_base_log.
  suffix=.txt
   timestamp=true/
  
   in the context declaration in the server.xml?
  
 
  This is just the output from ServletContext.log() calls, not the
  commons-logging calls.
 
   any suggestions?
  
   Regards Wendy
  
 
  Craig
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 

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




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




RE: Commons-logging and JDK 1.4 Logger

2002-11-26 Thread Wendy Cameron
Sorry for a late response to this topic,

But I have just put my commons-logging.properties file in place
and now I scratch my head and wonder:

1) How to I create a logger variable in all my classes?
2) How do I then log messages to the log file etc?

Regards Wendy

 -Original Message-
 From: Pete Gieser [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 19, 2002 9:01 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 Gee, didn't expect the formatting problem...
 
 commons-logging.properties attached instead.
 
  -Original Message-
  From: Pete Gieser [mailto:[EMAIL PROTECTED]] 
  Sent: Monday, November 18, 2002 5:57 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Commons-logging and JDK 1.4 Logger
  
  
  Just drop this file into WEB-INF/classes and select the 
 LogFactory and
  Log implementation of choice.
  
 

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-26 Thread Craig R. McClanahan


On Wed, 27 Nov 2002, Wendy Cameron wrote:

 Date: Wed, 27 Nov 2002 12:06:35 +1000
 From: Wendy Cameron [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: RE: Commons-logging and JDK 1.4 Logger

 Sorry for a late response to this topic,

 But I have just put my commons-logging.properties file in place
 and now I scratch my head and wonder:

 1) How to I create a logger variable in all my classes?

The same way Struts 1.1 classes do it would be good :-).

  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;

  ...
  private static Log log = LogFactory.getLog(...);
  ...

 2) How do I then log messages to the log file etc?

The same way Struts 1.1 classes do it would be good :-).

  if (log.isDebugEnabled()) {
log.debug(...);
  }


Use the source ... use the source ...

Or (gasp!) the docs:

  http://jakarta.apache.org/commons/logging/api/

:-)


 Regards Wendy


Craig


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




RE: Commons-logging and JDK 1.4 Logger

2002-11-26 Thread Wendy Cameron
Okay one more stupid question,

How do you switch debug on using the properties file in WEB-INF directory

Regards Wendy

 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 27, 2002 2:14 PM
 To: Struts Users Mailing List
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 
 
 On Wed, 27 Nov 2002, Wendy Cameron wrote:
 
  Date: Wed, 27 Nov 2002 12:06:35 +1000
  From: Wendy Cameron [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: RE: Commons-logging and JDK 1.4 Logger
 
  Sorry for a late response to this topic,
 
  But I have just put my commons-logging.properties file in place
  and now I scratch my head and wonder:
 
  1) How to I create a logger variable in all my classes?
 
 The same way Struts 1.1 classes do it would be good :-).
 
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
 
   ...
   private static Log log = LogFactory.getLog(...);
   ...
 
  2) How do I then log messages to the log file etc?
 
 The same way Struts 1.1 classes do it would be good :-).
 
   if (log.isDebugEnabled()) {
 log.debug(...);
   }
 
 
 Use the source ... use the source ...
 
 Or (gasp!) the docs:
 
   http://jakarta.apache.org/commons/logging/api/
 
 :-)
 
 
  Regards Wendy
 
 
 Craig
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-26 Thread Wendy Cameron
Well actually a few more stupid questions cause it doesnt work yet :)

I have created properties file with the following:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Jdk14Logger
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger

Placed it in WEB-INF directory and I have a debug statement in my code

log.trace(init(  +  actions + ));

in my j2re\lib directory if logging.properties
java.util.logging.FileHandler.pattern = C:\\inMotion\\logs\\java%u.log
Is this necessary or is this controlled by:

Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_image_base_log. suffix=.txt
  timestamp=true/

in the context declaration in the server.xml?

any suggestions?

Regards Wendy

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-26 Thread Craig R. McClanahan


On Wed, 27 Nov 2002, Wendy Cameron wrote:

 Date: Wed, 27 Nov 2002 15:09:19 +1000
 From: Wendy Cameron [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: RE: Commons-logging and JDK 1.4 Logger

 Well actually a few more stupid questions cause it doesnt work yet :)

 I have created properties file with the following:

 org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Jdk14Logger
 org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger

 Placed it in WEB-INF directory and I have a debug statement in my code

 log.trace(init(  +  actions + ));

 in my j2re\lib directory if logging.properties
 java.util.logging.FileHandler.pattern = C:\\inMotion\\logs\\java%u.log

This just says where the log messages go -- not what should be logged.  If
your logger is named com.foo.MyClass, you'd need to add:

  com.foo.MyClass.level = FINEST

or, if you wanted trace output from all the classes in the com.foo
package:

  com.foo.level = FINEST

For more information about configuring JDK logging, see the JDK
Documentation Bundle -- it's got an article specifically about the logging
features.

One other note -- the JDK logging properties are only read when a
particular JVM first starts using the logging calls, so you'll need to
restart Tomcat to make any changes take effect.

 Is this necessary or is this controlled by:

 Logger className=org.apache.catalina.logger.FileLogger
  prefix=localhost_image_base_log. suffix=.txt
 timestamp=true/

 in the context declaration in the server.xml?


This is just the output from ServletContext.log() calls, not the
commons-logging calls.

 any suggestions?

 Regards Wendy


Craig



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




RE: Commons-logging and JDK 1.4 Logger

2002-11-26 Thread Wendy Cameron
So let me get this straight:

I sought of got it to work however as usuall its coming out in the console and not 
where I want it to go and at a level INFO.  

I want to have one log file for the whole application at the moment.
I also want the same level of detail for all classes.

At the moment I cant figure out where to put things like

java.util.logging.FileHandler.pattern = C:\\inMotion\\logs\\java%u.log
java.util.logging.ConsoleHandler.level = FINEST

in the jdk logging.properties or in the commons-logging.properties in the WEB-INF
or is it supposed to go somewhere else.
Cause it doesnt seem to work from in the web inf directory at all

Basically my code for doing the logging seems okay, I just can seem to configure the 
logging process.

Regards Wendy

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




Re: Commons-logging and JDK 1.4 Logger

2002-11-18 Thread Eddie Bush
Mazza, Glen R., ,CPMS wrote:


Hello,

I am thinking of using the JDK 1.4 Logging API directly within some of my
web application classes.  Of course, Struts uses commons-logging for its
internal messages, so I still need to configure commons-logging to use the
JDK 1.4 Logging.


Yes - so why not just use commons-logging everywhere?  It makes you 
independent of any given logging implementation.  Then, if you later 
decide you need a syslog logger (oops!  I don't think Java provides for 
this!) or an SMTP logger (oops!  again!) - can you say daily rolling 
file appender? - you can just go right over to Log4J, change a couple of 
properties, and voila.  The fact of the matter is that there is some 
existing functionality in the Log4J logger implementations that the JDK 
does not have.  Rather than paint yourself in a corner, why not just use 
commons-logging everywhere and be independent of your logging 
implementation?

I am interested in using the same output logging file for both types of
messages:  those I explicitly call via JDK 1.4 Logging, and those messages
written by Struts via commons-logging.  Can I have them append to the *same*
output log file without concern for them overwriting each other's messages?


I don't see how both objects could have write-access to the same file at 
the same time - I would think this would be problematic.  I'm not sure 
how the logs are implemented, but I would think they would keep the file 
open to speed logging.

Thanks,
Glen


--
Eddie Bush




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




RE: Commons-logging and JDK 1.4 Logger

2002-11-18 Thread Wendy Cameron
So how do you configure commons logging to use the logging tool of your choice?

I thought if you use apache's logging scheme you are then locked into apache's logging 
functionality.

Regards Wendy

 -Original Message-
 From: Eddie Bush [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 19, 2002 9:47 AM
 To: Struts Users Mailing List
 Subject: Re: Commons-logging and JDK 1.4 Logger
 
 
 Mazza, Glen R., ,CPMS wrote:
 
 Hello,
 
 I am thinking of using the JDK 1.4 Logging API directly 
 within some of my
 web application classes.  Of course, Struts uses 
 commons-logging for its
 internal messages, so I still need to configure 
 commons-logging to use the
 JDK 1.4 Logging.
 
 Yes - so why not just use commons-logging everywhere?  It makes you 
 independent of any given logging implementation.  Then, if you later 
 decide you need a syslog logger (oops!  I don't think Java 
 provides for 
 this!) or an SMTP logger (oops!  again!) - can you say daily rolling 
 file appender? - you can just go right over to Log4J, change 
 a couple of 
 properties, and voila.  The fact of the matter is that there is some 
 existing functionality in the Log4J logger implementations 
 that the JDK 
 does not have.  Rather than paint yourself in a corner, why 
 not just use 
 commons-logging everywhere and be independent of your logging 
 implementation?
 
 I am interested in using the same output logging file for 
 both types of
 messages:  those I explicitly call via JDK 1.4 Logging, and 
 those messages
 written by Struts via commons-logging.  Can I have them 
 append to the *same*
 output log file without concern for them overwriting each 
 other's messages?
 
 I don't see how both objects could have write-access to the 
 same file at 
 the same time - I would think this would be problematic.  I'm 
 not sure 
 how the logs are implemented, but I would think they would 
 keep the file 
 open to speed logging.
 
 Thanks,
 Glen
 
 -- 
 Eddie Bush
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-18 Thread Sheela, Shravan

 So how do you configure commons logging to use the logging tool of your
choice?

Create a commons-logging.properties file and define the following property

org.apache.commons.logging.LogFactory

example

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategory
Log

If the implementation is log4j, you have to define the configuration of
log4j independent of the commons logging configuration.

Check out the jakarta site for more info.

- Shravan



I thought if you use apache's logging scheme you are then locked into
apache's logging functionality.

Regards Wendy

 -Original Message-
 From: Eddie Bush [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 19, 2002 9:47 AM
 To: Struts Users Mailing List
 Subject: Re: Commons-logging and JDK 1.4 Logger
 
 
 Mazza, Glen R., ,CPMS wrote:
 
 Hello,
 
 I am thinking of using the JDK 1.4 Logging API directly 
 within some of my
 web application classes.  Of course, Struts uses 
 commons-logging for its
 internal messages, so I still need to configure 
 commons-logging to use the
 JDK 1.4 Logging.
 
 Yes - so why not just use commons-logging everywhere?  It makes you 
 independent of any given logging implementation.  Then, if you later 
 decide you need a syslog logger (oops!  I don't think Java 
 provides for 
 this!) or an SMTP logger (oops!  again!) - can you say daily rolling 
 file appender? - you can just go right over to Log4J, change 
 a couple of 
 properties, and voila.  The fact of the matter is that there is some 
 existing functionality in the Log4J logger implementations 
 that the JDK 
 does not have.  Rather than paint yourself in a corner, why 
 not just use 
 commons-logging everywhere and be independent of your logging 
 implementation?
 
 I am interested in using the same output logging file for 
 both types of
 messages:  those I explicitly call via JDK 1.4 Logging, and 
 those messages
 written by Struts via commons-logging.  Can I have them 
 append to the *same*
 output log file without concern for them overwriting each 
 other's messages?
 
 I don't see how both objects could have write-access to the 
 same file at 
 the same time - I would think this would be problematic.  I'm 
 not sure 
 how the logs are implemented, but I would think they would 
 keep the file 
 open to speed logging.
 
 Thanks,
 Glen
 
 -- 
 Eddie Bush
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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




RE: Commons-logging and JDK 1.4 Logger

2002-11-18 Thread Karr, David
One way is to store a file named commons-logging.properties in your WEB-INF/classes 
directory, with the following approximate contents:

org.apache.commons.logging.Log = org.apache.commons.logging.impl.SimpleLog

This example sets the logger in use to the SimpleLog, but you can also use these 
(which are in the same package as SimpleLog:

Jdk14Logger
Log4JCategoryLog
LogKitLogger
NoOpLog

Each one of these has different ways to configure themselves.

 -Original Message-
 From: Wendy Cameron [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 18, 2002 2:46 PM
 To: Struts Users Mailing List
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 So how do you configure commons logging to use the logging 
 tool of your choice?
 
 I thought if you use apache's logging scheme you are then 
 locked into apache's logging functionality.
 
 Regards Wendy
 
  -Original Message-
  From: Eddie Bush [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 19, 2002 9:47 AM
  To: Struts Users Mailing List
  Subject: Re: Commons-logging and JDK 1.4 Logger
  
  
  Mazza, Glen R., ,CPMS wrote:
  
  Hello,
  
  I am thinking of using the JDK 1.4 Logging API directly 
  within some of my
  web application classes.  Of course, Struts uses 
  commons-logging for its
  internal messages, so I still need to configure 
  commons-logging to use the
  JDK 1.4 Logging.
  
  Yes - so why not just use commons-logging everywhere?  It makes you 
  independent of any given logging implementation.  Then, if 
 you later 
  decide you need a syslog logger (oops!  I don't think Java 
  provides for 
  this!) or an SMTP logger (oops!  again!) - can you say 
 daily rolling 
  file appender? - you can just go right over to Log4J, change 
  a couple of 
  properties, and voila.  The fact of the matter is that 
 there is some 
  existing functionality in the Log4J logger implementations 
  that the JDK 
  does not have.  Rather than paint yourself in a corner, why 
  not just use 
  commons-logging everywhere and be independent of your logging 
  implementation?
  
  I am interested in using the same output logging file for 
  both types of
  messages:  those I explicitly call via JDK 1.4 Logging, and 
  those messages
  written by Struts via commons-logging.  Can I have them 
  append to the *same*
  output log file without concern for them overwriting each 
  other's messages?
  
  I don't see how both objects could have write-access to the 
  same file at 
  the same time - I would think this would be problematic.  I'm 
  not sure 
  how the logs are implemented, but I would think they would 
  keep the file 
  open to speed logging.
  
  Thanks,
  Glen
  
  -- 
  Eddie Bush
  
  
  
  
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
  
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

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




RE: Commons-logging and JDK 1.4 Logger

2002-11-18 Thread Pete Gieser
Just drop this file into WEB-INF/classes and select the LogFactory and
Log
implementation of choice.

#
# commons-logging.properties
#

#---
---
# Select LogFactory:
#---
---
# Dynamically selects logging implementation class according to the
following:
#
# - Use a factory configuration attribute named
org.apache.commons.logging.Log 
#   to identify the requested implementation class. 
# 
# - Use the org.apache.commons.logging.Log system property to identify
the 
#   requested implementation class. 
#
# - If Log4J is available, return an instance of 
#   org.apache.commons.logging.impl.Log4JCategoryLog. 
#
# - If JDK 1.4 or later is available, return an instance of 
#   org.apache.commons.logging.impl.Jdk14Logger. 
#
# - Otherwise, return an instance of
org.apache.commons.logging.impl.NoOpLog. 
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Lo
gFactoryImpl
#
# Directly selects log4j logging implementation class.
#org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.L
og4jFactory

#---
---
# Select Logging implementation class
#---
---
# Simple commons-logging implementation (uses simplelog.properties)
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLo
g
# Maps to a Log4J category (uses log4j.properties)
#  note: org.apache.log4j.Category is deprecated in favor of
org.apache.log4j.Logger
#  and requests for a Category object will return a Logger object.
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCate
goryLog
# Wraps standard JDK1.4 logging mechanisms
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Log
ger
# Wraps jakarta-avalon-logkit
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLo
gger
# Throw away all messages, no configuration
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog


 -Original Message-
 From: Wendy Cameron [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, November 18, 2002 5:46 PM
 To: Struts Users Mailing List
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 So how do you configure commons logging to use the logging 
 tool of your choice?
 
 I thought if you use apache's logging scheme you are then 
 locked into apache's logging functionality.
 
 Regards Wendy
 
  -Original Message-
  From: Eddie Bush [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 19, 2002 9:47 AM
  To: Struts Users Mailing List
  Subject: Re: Commons-logging and JDK 1.4 Logger
  
  
  Mazza, Glen R., ,CPMS wrote:
  
  Hello,
  
  I am thinking of using the JDK 1.4 Logging API directly 
  within some of my
  web application classes.  Of course, Struts uses 
  commons-logging for its
  internal messages, so I still need to configure 
  commons-logging to use the
  JDK 1.4 Logging.
  
  Yes - so why not just use commons-logging everywhere?  It makes you 
  independent of any given logging implementation.  Then, if 
 you later 
  decide you need a syslog logger (oops!  I don't think Java 
  provides for 
  this!) or an SMTP logger (oops!  again!) - can you say 
 daily rolling 
  file appender? - you can just go right over to Log4J, change 
  a couple of 
  properties, and voila.  The fact of the matter is that 
 there is some 
  existing functionality in the Log4J logger implementations 
  that the JDK 
  does not have.  Rather than paint yourself in a corner, why 
  not just use 
  commons-logging everywhere and be independent of your logging 
  implementation?
  
  I am interested in using the same output logging file for 
  both types of
  messages:  those I explicitly call via JDK 1.4 Logging, and 
  those messages
  written by Struts via commons-logging.  Can I have them 
  append to the *same*
  output log file without concern for them overwriting each 
  other's messages?
  
  I don't see how both objects could have write-access to the 
  same file at 
  the same time - I would think this would be problematic.  I'm 
  not sure 
  how the logs are implemented, but I would think they would 
  keep the file 
  open to speed logging.
  
  Thanks,
  Glen
  
  -- 
  Eddie Bush
  
  
  
  
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
  
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 


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




RE: Commons-logging and JDK 1.4 Logger

2002-11-18 Thread Pete Gieser
Gee, didn't expect the formatting problem...

commons-logging.properties attached instead.

 -Original Message-
 From: Pete Gieser [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, November 18, 2002 5:57 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Commons-logging and JDK 1.4 Logger
 
 
 Just drop this file into WEB-INF/classes and select the LogFactory and
 Log implementation of choice.
 



commons-logging.properties
Description: Binary data
--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]