log4j set up and usage?

2004-03-04 Thread Dean A. Hoover
Where can I find an example of setting up
and using log4j under commons-logging
for struts 1.1? I have used log4j before and
want to continue using it.
Dean Hoove

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


Re: log4j set up and usage?

2004-03-04 Thread Henri Yandell

http://jakarta.apache.org/commons/logging/guide.html is the help for
logging+log4j. Mainly it should just be having log4j in some way in the
classpath, though
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
looks useable too.

Hen

On Thu, 4 Mar 2004, Dean A. Hoover wrote:

 Where can I find an example of setting up
 and using log4j under commons-logging
 for struts 1.1? I have used log4j before and
 want to continue using it.

 Dean Hoove


 -
 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 set up and usage?

2004-03-04 Thread Martin Gainty
Henri
The log4j list admin and AN extremely resourceful engineer (the guy who
knows log4j better than anyone)
 is Ceki Gulcu His email address is
cekiapache.org

Best Regards,
~Martin

Instructor/Consultant/Chess Nut
(http)www.laconiadatasystems.com
(land)001-617-864-1139

 Original Message -
From: Henri Yandell [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 8:34 AM
Subject: Re: log4j set up and usage?



 http://jakarta.apache.org/commons/logging/guide.html is the help for
 logging+log4j. Mainly it should just be having log4j in some way in the
 classpath, though
 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er
 looks useable too.

 Hen

 On Thu, 4 Mar 2004, Dean A. Hoover wrote:

  Where can I find an example of setting up
  and using log4j under commons-logging
  for struts 1.1? I have used log4j before and
  want to continue using it.
 
  Dean Hoove
 
 
  -
  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 set up and usage?

2004-03-04 Thread Henri Yandell

If the logging docs aren't enough, the commons-users or the log4j lists
would be better. People shouldn't be mailing a developer directly as it
benefits no one.

Hen

On Thu, 4 Mar 2004, Martin Gainty wrote:

 Henri
 The log4j list admin and AN extremely resourceful engineer (the guy who
 knows log4j better than anyone)
  is Ceki Gulcu His email address is
 cekiapache.org

 Best Regards,
 ~Martin

 Instructor/Consultant/Chess Nut
 (http)www.laconiadatasystems.com
 (land)001-617-864-1139

  Original Message -
 From: Henri Yandell [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Thursday, March 04, 2004 8:34 AM
 Subject: Re: log4j set up and usage?


 
  http://jakarta.apache.org/commons/logging/guide.html is the help for
  logging+log4j. Mainly it should just be having log4j in some way in the
  classpath, though
  -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
 er
  looks useable too.
 
  Hen
 
  On Thu, 4 Mar 2004, Dean A. Hoover wrote:
 
   Where can I find an example of setting up
   and using log4j under commons-logging
   for struts 1.1? I have used log4j before and
   want to continue using it.
  
   Dean Hoove
  
  
   -
   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]
 
 



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



log4j example?

2004-03-02 Thread Dean A. Hoover
Where can I find an example of setting up
and using log4j under commons-logging
for struts 1.1? I have used log4j before and
want to continue using it.
Dean Hoover

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


example of using log4j in struts 1.1?

2004-02-29 Thread Dean A. Hoover
I am interested in using log4j as a logger
for a struts 1.1 application. Is there an
example, cookbook, or other documentation
someone can point me to for this?
Thanks.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Log4J configuration -- Regarding

2004-02-22 Thread Vasudevrao Gupta

Hi All,

I am trying to configure Log4j to your application.I am trying to configure
with Log4j1.2.8 using xml file.

I am getting the below error:
[2/23/04 20:34:12:719 IST] 105af116 SystemErr R log4j:ERROR Could not
parse input source [EMAIL PROTECTED]
[2/23/04 20:34:12:719 IST] 105af116 SystemErr R
java.net.MalformedURLException: unknown protocol: dummy

Please help me in gettign away with this.

ThankYou

VasudevRaoGupta


Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Log4J configuration -- Regarding

2004-02-22 Thread Richard Yee
Send your log4j config file so we can take a look at it.

-R

At 07:08 AM 2/23/2004, you wrote:

Hi All,

I am trying to configure Log4j to your application.I am trying to configure
with Log4j1.2.8 using xml file.
I am getting the below error:
[2/23/04 20:34:12:719 IST] 105af116 SystemErr R log4j:ERROR Could not
parse input source [EMAIL PROTECTED]
[2/23/04 20:34:12:719 IST] 105af116 SystemErr R
java.net.MalformedURLException: unknown protocol: dummy
Please help me in gettign away with this.

ThankYou

VasudevRaoGupta

Confidentiality Notice

The information contained in this electronic message and any attachments 
to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or 
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

-
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: [OT] RE: log4j integration

2004-01-29 Thread shankarr
hi!
I am still not clear as to where I need to write this class or method.
Will it not suffice to give the entries in the web.xml file itself.
This is the first time I am dealing with these, so please help.
What I have done till now is to get the static logger instance in the class 
and then put the logger.debug(xx); prints.
I need to know this :
a) In the struts framework, will it not suffice to just put entries in the 
web.xml
If not, then where in the framework should I write my class that uses the 
log4j apis?

Richie

At 12:50 PM 1/28/2004 -0500, you wrote:
Yup, that should work just fine. If you want to be able to modify the config
info while the app is running (e.g. turn on debugging in production without
reloading the app), here's another approach.
Create a directory and place it on the app server's classpath. For WLS
(depending on how you do your install and create your domains), it might be
something like C:\bea8\user_projects\domains\dotech\applib.
For each app, place a unique Log4j config file in the directory. For example,
app1-log4j.xml and app2-log4j.xml.
In your app's web.xml file, include context-param or env-entry 
elements for
the name of the config file and the watch delay value:

env-entry
  descriptionLog4j resource file name/description
  env-entry-namelog4j/resource/env-entry-name
  env-entry-valueapp1-log4j.xml/env-entry-value
  env-entry-typejava.lang.String/env-entry-type
/env-entry
env-entry
  descriptionLog4j resource file watch delay/description
  env-entry-namelog4j/watchDelay/env-entry-name
  env-entry-value3/env-entry-value
  env-entry-typejava.lang.Long/env-entry-type
/env-entry
Finally, create a context listener (or startup servlet) to perform the
configuration:
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup(java:comp/env);
String log4jResourceName = (String)envCtx.lookup(log4j/resource);
URL log4jResourceURL = cl.getResource(log4jResourceName);
String contentType = log4jResourceURL.openConnection().getContentType();
String fileName = log4jResourceURL.getFile();
Long log4jWatchDelay = (Long)envCtx.lookup(log4j/watchDelay);
long watchDelay = log4jWatchDelay.longValue();
if (application/xml.equals(contentType)) {
  DOMConfigurator.configureAndWatch(fileName, watchDelay);
} else {
  PropertyConfigurator.configureAndWatch(fileName, watchDelay);
}
It's not so bad with some additonal help from Ant. I've also used this 
approach
to make it a bit less painful for multiple developers to share a single WLS
instance during development.

Quoting Chappell, Simon P [EMAIL PROTECTED]:

 Jacob,

 We use log4j 1.2.8 and we include the jar file right in out WEB-INF/lib
 directory of our application. The log4j.properties file then lives 
inside the
 WEB-INF/classes directory. This works well for us on IBM's WAS 4.x.

 I've never seen anyone recommend having log4j at the container level, so go
 with it at the application level and forget about conventional wisdom! :-)

 Hope this helps.

 Simon

 -
 Simon P. Chappell [EMAIL PROTECTED]
 Java Programming Specialist  www.landsend.com
 Lands' End, Inc.   (608) 935-4526

 Wisdom is not the prerogative of the academics. - Peter Chappell

 -Original Message-
 From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 11:08 AM
 To: Struts Users Mailing List
 Subject: [OT] RE: log4j integration
 
 
 I'm wondering if anyone has gotten log4j to be deployed within separate
 apps?  We are having issues with log4j jars and their
 properties files being
 deployed on each application under Weblogic.  Most of what I've read
 recommends putting log4j at the container level along with a single
 properties file, but that isn't as flexible as what we want it to be.
 
 -Thanks
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 
 Sent: Wednesday, January 28, 2004 10:20 AM
 To: [EMAIL PROTECTED]
 Subject: RE: log4j integration
 
 Hi,
 Also there is something called
 ReloadingPropertyConfigurator..May be this in
 combination with HierarchyEventListener will do the trick for you.
 
 I mean the log4j API is so feature rich, you should not be
 required to write
 something for such a common task.
 
 regards,
 Shirish.
 
 -Original Message-
 From: Geeta Ramani [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 4:02 PM
 To: Struts Users Mailing List
 Subject: Re: log4j integration
 
 
 *Yes*!!  The LogManager is the ticket - I didn't know about
 this class, so
 tried it
 out.  Works like a charm.. :) Thanks, Shirish (I think?  I
 inadvertently
 erased the
 response to this question so am not sure of its author..)
 
 Geeta

--
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com

AUTO {ICICICARE#005-212-151}[OT] RE: log4j integration

2004-01-29 Thread NRI Cell
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your 
mail and assure you of a response shortly.To help us serve you better, we would 
request you to kindly mention your account number or any reference number you may have 
in your future correspondence.  Kindly visit our website www.icicibank.com\nri to know 
more on our products and services.  With regards,Customer Care 
ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and 
confidential, and is directed to and for the use of the addressee only. If this 
message reaches anyone other than the intended recipient, we request the reader not to 
reproduce, copy, disseminate or in any manner distribute it. We further request such 
recipient to notify us immediately by return email and delete the original message. 
ICICI Bank Ltd. does not guarantee the security of any information transmitted 
electronically and is not liable for the proper, timely and complete transmission 
thereof. Before opening any attachments please check them for viruses and defects.



RE: [OT] RE: log4j integration

2004-01-29 Thread shankarr
Hi!
I managed to get it working.
I wrote a Servlet and gave the entry in the web.xml file and in my file 
called the logging file
I could not use the following though
env-entry
  descriptionLog4j resource file name/description
  env-entry-namelog4j/resource/env-entry-name
  env-entry-valueapp1-log4j.xml/env-entry-value
  env-entry-typejava.lang.String/env-entry-type
/env-entry
env-entry
  descriptionLog4j resource file watch delay/description
  env-entry-namelog4j/watchDelay/env-entry-name
  env-entry-value3/env-entry-value
  env-entry-typejava.lang.Long/env-entry-type
/env-entry
as it gave me , the name is not bound in the context error.

Thanks once again folks!
Richie
At 01:02 PM 1/29/2004 +0530, you wrote:
hi!
I am still not clear as to where I need to write this class or method.
Will it not suffice to give the entries in the web.xml file itself.
This is the first time I am dealing with these, so please help.
What I have done till now is to get the static logger instance in the 
class and then put the logger.debug(xx); prints.
I need to know this :
a) In the struts framework, will it not suffice to just put entries in the 
web.xml
If not, then where in the framework should I write my class that uses the 
log4j apis?

Richie

At 12:50 PM 1/28/2004 -0500, you wrote:
Yup, that should work just fine. If you want to be able to modify the config
info while the app is running (e.g. turn on debugging in production without
reloading the app), here's another approach.
Create a directory and place it on the app server's classpath. For WLS
(depending on how you do your install and create your domains), it might be
something like C:\bea8\user_projects\domains\dotech\applib.
For each app, place a unique Log4j config file in the directory. For example,
app1-log4j.xml and app2-log4j.xml.
In your app's web.xml file, include context-param or env-entry 
elements for
the name of the config file and the watch delay value:

env-entry
  descriptionLog4j resource file name/description
  env-entry-namelog4j/resource/env-entry-name
  env-entry-valueapp1-log4j.xml/env-entry-value
  env-entry-typejava.lang.String/env-entry-type
/env-entry
env-entry
  descriptionLog4j resource file watch delay/description
  env-entry-namelog4j/watchDelay/env-entry-name
  env-entry-value3/env-entry-value
  env-entry-typejava.lang.Long/env-entry-type
/env-entry
Finally, create a context listener (or startup servlet) to perform the
configuration:
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup(java:comp/env);
String log4jResourceName = (String)envCtx.lookup(log4j/resource);
URL log4jResourceURL = cl.getResource(log4jResourceName);
String contentType = log4jResourceURL.openConnection().getContentType();
String fileName = log4jResourceURL.getFile();
Long log4jWatchDelay = (Long)envCtx.lookup(log4j/watchDelay);
long watchDelay = log4jWatchDelay.longValue();
if (application/xml.equals(contentType)) {
  DOMConfigurator.configureAndWatch(fileName, watchDelay);
} else {
  PropertyConfigurator.configureAndWatch(fileName, watchDelay);
}
It's not so bad with some additonal help from Ant. I've also used this 
approach
to make it a bit less painful for multiple developers to share a single WLS
instance during development.

Quoting Chappell, Simon P [EMAIL PROTECTED]:

 Jacob,

 We use log4j 1.2.8 and we include the jar file right in out WEB-INF/lib
 directory of our application. The log4j.properties file then lives 
inside the
 WEB-INF/classes directory. This works well for us on IBM's WAS 4.x.

 I've never seen anyone recommend having log4j at the container level, 
so go
 with it at the application level and forget about conventional wisdom! :-)

 Hope this helps.

 Simon

 -
 Simon P. Chappell [EMAIL PROTECTED]
 Java Programming Specialist  www.landsend.com
 Lands' End, Inc.   (608) 935-4526

 Wisdom is not the prerogative of the academics. - Peter Chappell

 -Original Message-
 From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 11:08 AM
 To: Struts Users Mailing List
 Subject: [OT] RE: log4j integration
 
 
 I'm wondering if anyone has gotten log4j to be deployed within separate
 apps?  We are having issues with log4j jars and their
 properties files being
 deployed on each application under Weblogic.  Most of what I've read
 recommends putting log4j at the container level along with a single
 properties file, but that isn't as flexible as what we want it to be.
 
 -Thanks
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 
 Sent: Wednesday, January 28, 2004 10:20 AM
 To: [EMAIL PROTECTED]
 Subject: RE: log4j integration
 
 Hi,
 Also there is something called
 ReloadingPropertyConfigurator..May be this in
 combination with HierarchyEventListener

Re: log4j integration

2004-01-29 Thread Geeta Ramani
Hi Shankar:

Two other people asked this same question so if you don't mind, I'll
post my (simple) solution to the list.  Btw, for those who don't
remember, this is a way to enable changes in log4j.properties to be seen
by the application without a server reboot.  Here goes:

1. Create a simple action class say ReloadLog4jAction with just a couple
of statements in the perform/execute method: Create a new LogManager,
then call its resetConfiguration() method. (Write the class within the
application context where you want your log4j.properties file
reconfigured)
2. Create the appropriate action mapping in your struts-config.xml, so
that (say) /admin/reloadLog4j.do would map to this class and maybe
redirect to an OK page. (am following the way /admin/reload.do works).

3. Reload struts-config either by server restart (or simply by calling
/admin/reload.do if you have that mapping in your struts-config.xml.) Of
course you will need to do this just once..
4. Make any changes to your log4j.properties file and then point your
browser now to the url /admin/reloadLog4j.do. The log4j.properties file
will then be reloaded and after your OK page displays, the new
log4j.properties file will then be read in.

Really simple and works so nicely..:)
Regards,
Geeta

shankarr wrote:

 Hi Geeta,

 If you could let me know how to achieve the integration will be great.

 Where have you written the class which observes the file?
 What I mean is, where in the struts framework are u using it at the
 RequestProcessor level or what.
 As I understand, in order for making the struts application in itself
 monitor the file, I need to write some init file only .
 Which class to extend and where do I put the entries.
 Sample code for the class file and the web.xml entries will be greatly
 appreciated.

 Shankar

 To achieve all that is possible, one must attempt the impossible



Re: log4j integration

2004-01-29 Thread shankarr
Hi Geeta.

Thanks for the response.
I have been able to get the thing done in an alternate manner which I have 
posted.
Do let me know your comments on the same if time permits.
The method you have suggested is new to me. I will definitely give it a shot.

Thanks for the help to all.
Richie
At 08:02 AM 1/29/2004 -0500, you wrote:
Hi Shankar:

Two other people asked this same question so if you don't mind, I'll
post my (simple) solution to the list.  Btw, for those who don't
remember, this is a way to enable changes in log4j.properties to be seen
by the application without a server reboot.  Here goes:
1. Create a simple action class say ReloadLog4jAction with just a couple
of statements in the perform/execute method: Create a new LogManager,
then call its resetConfiguration() method. (Write the class within the
application context where you want your log4j.properties file
reconfigured)
2. Create the appropriate action mapping in your struts-config.xml, so
that (say) /admin/reloadLog4j.do would map to this class and maybe
redirect to an OK page. (am following the way /admin/reload.do works).
3. Reload struts-config either by server restart (or simply by calling
/admin/reload.do if you have that mapping in your struts-config.xml.) Of
course you will need to do this just once..
4. Make any changes to your log4j.properties file and then point your
browser now to the url /admin/reloadLog4j.do. The log4j.properties file
will then be reloaded and after your OK page displays, the new
log4j.properties file will then be read in.
Really simple and works so nicely..:)
Regards,
Geeta
shankarr wrote:

 Hi Geeta,

 If you could let me know how to achieve the integration will be great.

 Where have you written the class which observes the file?
 What I mean is, where in the struts framework are u using it at the
 RequestProcessor level or what.
 As I understand, in order for making the struts application in itself
 monitor the file, I need to write some init file only .
 Which class to extend and where do I put the entries.
 Sample code for the class file and the web.xml entries will be greatly
 appreciated.

 Shankar

 To achieve all that is possible, one must attempt the impossible

To achieve all that is possible, one must attempt the impossible



AUTO {ICICICARE#005-217-937}log4j integration

2004-01-29 Thread NRI Cell
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your 
mail and assure you of a response shortly.To help us serve you better, we would 
request you to kindly mention your account number or any reference number you may have 
in your future correspondence.  Kindly visit our website www.icicibank.com\nri to know 
more on our products and services.  With regards,Customer Care 
ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and 
confidential, and is directed to and for the use of the addressee only. If this 
message reaches anyone other than the intended recipient, we request the reader not to 
reproduce, copy, disseminate or in any manner distribute it. We further request such 
recipient to notify us immediately by return email and delete the original message. 
ICICI Bank Ltd. does not guarantee the security of any information transmitted 
electronically and is not liable for the proper, timely and complete transmission 
thereof. Before opening any attachments please check them for viruses and defects.



RE: log4j integration

2004-01-29 Thread Norm Deane
We use an alternative approach that allows for a more dynamic log4j
configuration approach.  In our webapps we have a Servlet that loads on
startup that is responsible for configuring log4j and updating the log4j
configuration when the configuration file changes.  


web.xml-sinppets

   servlet
  servlet-nameLog4JConfigurator/servlet-name
 
servlet-classedu.vanderbilt.mis.log4j.ConfigureLog4jServlet/servlet-class

  init-param
 param-namereloadDelay/param-name
 param-value30/param-value
 /init-param
  init-param
param-namepropertyFile/param-name
   param-value/log4j/fis/config/edog.log4j.properties/param-value
  /init-param
  load-on-startup1/load-on-startup
   /servlet

   servlet-mapping
  servlet-nameLog4JConfigurator/servlet-name
  url-pattern/config/url-pattern
   /servlet-mapping

/web.xml-sinppets



servlet-code

package edu.vanderbilt.mis.log4j;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

import org.apache.log4j.*;
import org.apache.log4j.spi.*;
import org.apache.log4j.helpers.*;
import java.net.URL;

/**
 * Handles the initialization of Log4j.  On startup, this method with deifne
 * the reload frequency of the property file and where the property file is
 * located.
 * p
 * This servlet expects two properties to be defined as configuration
 * properties.  They are as follows...
 * ul
 * lireloadDelay - the number of miliseconds to wait before reloading the
property file./li
 * lipropertyFile - the property file to be reloaded./li
 * /ul
 * @author unascribed
 * @version 1.0
 */
public class ConfigureLog4jServlet  extends HttpServlet
{
   public static final String RELOAD_DELAY_PROPERTY_NAME = reloadDelay;
   public static final String PROPERTY_FILE_PROPERTY_NAME = propertyFile;

   /**
* Handles the initialization of Log4j.  On startup, this method with
deifne
* the reload frequency of the property file and where the property file
is
* located.
*/
   public void init( ServletConfig config ) throws ServletException
   {
  super.init( config );
  long delay = getReloadDelay();
  LogLog.debug( Reload Delay is [ + delay + ] );

  String cfgFile = getPropertyFileLocation();
  LogLog.debug( Log4j configuration file is [ + cfgFile + ] );

  if ( cfgFile == null )
 throw new ServletException( Log4j configuration file was not
specified. );

  PropertyConfigurator.configureAndWatch( cfgFile, delay );
   }


   /**
* Diaplays the reload delay and the location of the configuration file.
*/
public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
{
  response.addHeader( Cache-Control, no-cache );
  response.addHeader( Pragma, no-cache );
  response.addHeader( Expires, -1 );
  response.setContentType( text/html );

  PrintWriter out = response.getWriter();

  out.println( HTMLBODY );
  out.println( BLog4J Configurator/BBRBR );
  out.println( Reload Delay is [ + getReloadDelay() + ]
millisecondsbr );
  out.println( Configuration File is [ + getPropertyFileLocation() +
] );

  File logConfigFile = new File( getPropertyFileLocation() );
  if ( !logConfigFile.exists() )
  {
 out.println( pConfiguration file does not exist/p );
  }
  else
  {
 out.println( pConfiguration file contents/p );
 out.println( pre );

 FileReader fReader = new FileReader( logConfigFile );
 BufferedReader bReader = new BufferedReader( fReader );


 String line = null;
 while (  (line = bReader.readLine() ) != null)
 {
out.println( line );
 }
  }
  out.println( /pre );
  out.println( /BODY/HTML );
  out.close();
}


   /**
* Returns the reload delay for the Log4J configuration file.  This
method
* first checks for the reload delay property in the web.xml.  If it is
not
* set in the web.xml the default is used as defined in the FileWatchDog.
*/
   public long getReloadDelay()
   {
  String s = getServletConfig().getInitParameter(
RELOAD_DELAY_PROPERTY_NAME );
  try
  {
 return new Long( s ).longValue();
  }
  catch ( NumberFormatException nfe )
  {
 return FileWatchdog.DEFAULT_DELAY;
  }
   }

   /**
* Returns the location of the log4j property file.  The property file
location
* should be an init parameter for this servlet.
*/
   public String getPropertyFileLocation()
   {
  return getServletConfig().getInitParameter(
PROPERTY_FILE_PROPERTY_NAME );
   }
}

/servlet-code

-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
[EMAIL PROTECTED] 

 -Original Message-
 From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, January 28, 2004 6:01 AM
 To: Struts Users Mailing List
 Subject: Re: log4j integration
 
 
 Please forgive

AUTO {ICICICARE#005-220-427}log4j integration

2004-01-29 Thread NRI Cell
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your 
mail and assure you of a response shortly.To help us serve you better, we would 
request you to kindly mention your account number or any reference number you may have 
in your future correspondence.  Kindly visit our website www.icicibank.com\nri to know 
more on our products and services.  With regards,Customer Care 
ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and 
confidential, and is directed to and for the use of the addressee only. If this 
message reaches anyone other than the intended recipient, we request the reader not to 
reproduce, copy, disseminate or in any manner distribute it. We further request such 
recipient to notify us immediately by return email and delete the original message. 
ICICI Bank Ltd. does not guarantee the security of any information transmitted 
electronically and is not liable for the proper, timely and complete transmission 
thereof. Before opening any attachments please check them for viruses and defects.



log4j with struts1.1

2004-01-28 Thread shankarr
Hi!

I have integrated log4j with struts1.1.

I am able to see the prints also.
If I make changes to the log4j.properties file, I have to ensure that the 
changes take effect .
I do not know how to do this step.
Please help.

The following is my class in which I put the prints.

// Import log4j classes.
import org.apache.log4j.*;
public class LoginAction extends Action
{
static Logger logger = Logger.getLogger(LoginAction.class);
PropertyConfigurator propConfigurator = new PropertyConfigurator();

public ActionForward perform (ActionMapping mapping,ActionForm 
form,HttpServletRequest req,HttpServletResponse res)
{
//System.out.println(in LoginAction);
//need to log the above line using log4j

if(logger.isEnabledFor(Level.DEBUG))
{
System.out.println( in 1);
logger.debug(One !!!);
}
DynaValidatorForm rf = (DynaValidatorForm) form;
String username = (String)(rf.get(username));
String password = (String)(rf.get(password));
logger.debug(debug    0);
logger.info(info   1);
logger.warn(warn   2);
logger.error(error   ..3);
logger.fatal(fatal   4);
return mapping.findForward(failure);
}
}

Thanks,
Richie
To achieve all that is possible, one must attempt the impossible



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


Re: log4j integration

2004-01-28 Thread Geeta Ramani
Please forgive this note if it seems too obvious and I have misunderstood your
question/comments..

If you think of both struts and log4j as just a bunch of Java packages/classes,
then you will see that integrating struts with log4j is really nothing
unusual.  The log4j jar (or classes in the jar) needs a log4j.properties file
(the name of this file is most probably hard-coded in the classes in log4j jar,
which is why you don't need to personally tie the file with log4j) and this file
should therefore be in the classpath and as you have found out yourself, this is
all that is required...If for some reason you need a handle to this file, I
don't see why the usual File class in the java.io package won't do the trick..?

As for how to ensure that changes in your log4j.properties is made visible to
struts, well, I guess you'll have to restart tomcat (or your app server)..(:( I
don't believe the admin/reload.do will work (that works for changes to the
struts-config.xml and such a blessing *that* is during development!!) ..

Hope this helps,
Geeta

shankarr wrote:

 Hi!

 In fact, I got two responses for the question as I had sent the same
 question twice.
 My mailbox was acting funny yesterday, so I had to send it twice.

 Well, I do have the log4j.properties file under web-inf/classes
 I had thought of using the PropertyConfigurator too.
 But, when you integrate log4j with struts, we no where mention the
 log4j.properties file specifically, ie, we
 just create the file and put it under the mentioned location.
 And when we use it, we do not mention the log4j.properties file anywhere in
 the files too.
 So, how to get a handle to the file?
 Correct me if there are better approaches to the same.

 Steps by which I integrated are :

 a)Got the log4j.jar file
 b)created the log4j.properties file
 c)created commons-logging.properties file
 d) used static logger = new logger(this) in the files where this is the
 class name.

 TIA,

 Richie

 At 02:28 PM 1/27/2004 -0600, you wrote:
 Do you mean changes made after the initial configuration of log4j?  You can
 use
 
  PropertyConfigurator.configureAndWatch( cfgFile, delay )
 
 This will load your log4j configuration file and create a thread that looks
 for changes to the config file reloading when necessary.
 
 --Norm
 
 --
 Norm Deane
 MIS Consultant
 Vanderbilt University
 (615) 322-7855
 [EMAIL PROTECTED]
 
   -Original Message-
   From: shankarr [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, January 27, 2004 9:14 AM
   To: [EMAIL PROTECTED]
   Subject: log4j integration
  
  
   Hi!
   I have integrated log4j with struts.
   I need to know how to ensure that the changes done to
   log4j.properties file
   is taken into account at run time.
   TIA,
   Richie
  
   To achieve all that is possible, one must attempt the impossible
  
  
  
   -
   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]

 To achieve all that is possible, one must attempt the impossible


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



Re: log4j integration

2004-01-28 Thread shankarr
Hi!

Yes, I figured that out.
But, that leaves the question open as to how do you make struts as a whole 
understand that changes have been
made to the log4j.properties file.
In fact, the question boils down to this:
Where do I get the handle to the log4j.properties file(let us say, using 
the File class)?
And once I do, will it be sufficient that I set the PropertyConfigurator 
method with the requisite parameters?
Actually, the whole point of the exercise is to use the dynamic reloading 
of changes made to the log4j.properties file facility provided by log4j.

Richie

At 07:01 AM 1/28/2004 -0500, you wrote:
Please forgive this note if it seems too obvious and I have misunderstood your
question/comments..
If you think of both struts and log4j as just a bunch of Java 
packages/classes,
then you will see that integrating struts with log4j is really nothing
unusual.  The log4j jar (or classes in the jar) needs a log4j.properties file
(the name of this file is most probably hard-coded in the classes in log4j 
jar,
which is why you don't need to personally tie the file with log4j) and 
this file
should therefore be in the classpath and as you have found out yourself, 
this is
all that is required...If for some reason you need a handle to this file, I
don't see why the usual File class in the java.io package won't do the 
trick..?

As for how to ensure that changes in your log4j.properties is made visible to
struts, well, I guess you'll have to restart tomcat (or your app 
server)..(:( I
don't believe the admin/reload.do will work (that works for changes to the
struts-config.xml and such a blessing *that* is during development!!) ..

Hope this helps,
Geeta
shankarr wrote:

 Hi!

 In fact, I got two responses for the question as I had sent the same
 question twice.
 My mailbox was acting funny yesterday, so I had to send it twice.

 Well, I do have the log4j.properties file under web-inf/classes
 I had thought of using the PropertyConfigurator too.
 But, when you integrate log4j with struts, we no where mention the
 log4j.properties file specifically, ie, we
 just create the file and put it under the mentioned location.
 And when we use it, we do not mention the log4j.properties file anywhere in
 the files too.
 So, how to get a handle to the file?
 Correct me if there are better approaches to the same.

 Steps by which I integrated are :

 a)Got the log4j.jar file
 b)created the log4j.properties file
 c)created commons-logging.properties file
 d) used static logger = new logger(this) in the files where this is the
 class name.

 TIA,

 Richie

 At 02:28 PM 1/27/2004 -0600, you wrote:
 Do you mean changes made after the initial configuration of 
log4j?  You can
 use
 
  PropertyConfigurator.configureAndWatch( cfgFile, delay )
 
 This will load your log4j configuration file and create a thread that 
looks
 for changes to the config file reloading when necessary.
 
 --Norm
 
 --
 Norm Deane
 MIS Consultant
 Vanderbilt University
 (615) 322-7855
 [EMAIL PROTECTED]
 
   -Original Message-
   From: shankarr [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, January 27, 2004 9:14 AM
   To: [EMAIL PROTECTED]
   Subject: log4j integration
  
  
   Hi!
   I have integrated log4j with struts.
   I need to know how to ensure that the changes done to
   log4j.properties file
   is taken into account at run time.
   TIA,
   Richie
  
   To achieve all that is possible, one must attempt the impossible
  
  
  
   -
   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]

 To achieve all that is possible, one must attempt the impossible

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To achieve all that is possible, one must attempt the impossible



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


RE: log4j integration

2004-01-28 Thread shirishchandra.sakhare
There is LogManagerclass with LoG4j.
It allows you to reset the configuration for entire LOG4J environment.And then as you 
said, you can reread the property file to initialise the log4j environment from the 
changed property file.

HTH:
regards,
Shirish




-Original Message-
From: shankarr [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 1:20 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


Hi!

Yes, I figured that out.
But, that leaves the question open as to how do you make struts as a whole 
understand that changes have been
made to the log4j.properties file.
In fact, the question boils down to this:
Where do I get the handle to the log4j.properties file(let us say, using 
the File class)?
And once I do, will it be sufficient that I set the PropertyConfigurator 
method with the requisite parameters?
Actually, the whole point of the exercise is to use the dynamic reloading 
of changes made to the log4j.properties file facility provided by log4j.

Richie

At 07:01 AM 1/28/2004 -0500, you wrote:
Please forgive this note if it seems too obvious and I have misunderstood your
question/comments..

If you think of both struts and log4j as just a bunch of Java 
packages/classes,
then you will see that integrating struts with log4j is really nothing
unusual.  The log4j jar (or classes in the jar) needs a log4j.properties file
(the name of this file is most probably hard-coded in the classes in log4j 
jar,
which is why you don't need to personally tie the file with log4j) and 
this file
should therefore be in the classpath and as you have found out yourself, 
this is
all that is required...If for some reason you need a handle to this file, I
don't see why the usual File class in the java.io package won't do the 
trick..?

As for how to ensure that changes in your log4j.properties is made visible to
struts, well, I guess you'll have to restart tomcat (or your app 
server)..(:( I
don't believe the admin/reload.do will work (that works for changes to the
struts-config.xml and such a blessing *that* is during development!!) ..

Hope this helps,
Geeta

shankarr wrote:

  Hi!
 
  In fact, I got two responses for the question as I had sent the same
  question twice.
  My mailbox was acting funny yesterday, so I had to send it twice.
 
  Well, I do have the log4j.properties file under web-inf/classes
  I had thought of using the PropertyConfigurator too.
  But, when you integrate log4j with struts, we no where mention the
  log4j.properties file specifically, ie, we
  just create the file and put it under the mentioned location.
  And when we use it, we do not mention the log4j.properties file anywhere in
  the files too.
  So, how to get a handle to the file?
  Correct me if there are better approaches to the same.
 
  Steps by which I integrated are :
 
  a)Got the log4j.jar file
  b)created the log4j.properties file
  c)created commons-logging.properties file
  d) used static logger = new logger(this) in the files where this is the
  class name.
 
  TIA,
 
  Richie
 
  At 02:28 PM 1/27/2004 -0600, you wrote:
  Do you mean changes made after the initial configuration of 
 log4j?  You can
  use
  
   PropertyConfigurator.configureAndWatch( cfgFile, delay )
  
  This will load your log4j configuration file and create a thread that 
 looks
  for changes to the config file reloading when necessary.
  
  --Norm
  
  --
  Norm Deane
  MIS Consultant
  Vanderbilt University
  (615) 322-7855
  [EMAIL PROTECTED]
  
-Original Message-
From: shankarr [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 9:14 AM
To: [EMAIL PROTECTED]
Subject: log4j integration
   
   
Hi!
I have integrated log4j with struts.
I need to know how to ensure that the changes done to
log4j.properties file
is taken into account at run time.
TIA,
Richie
   
To achieve all that is possible, one must attempt the impossible
   
   
   
-
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]
 
  To achieve all that is possible, one must attempt the impossible


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

To achieve all that is possible, one must attempt the impossible



-
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 integration

2004-01-28 Thread Geeta Ramani
*Yes*!!  The LogManager is the ticket - I didn't know about this class, so tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I inadvertently erased the
response to this question so am not sure of its author..)

Geeta


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



RE: log4j integration

2004-01-28 Thread shirishchandra.sakhare
Hi,
Also there is something called ReloadingPropertyConfigurator..May be this in 
combination with HierarchyEventListener will do the trick for you.

I mean the log4j API is so feature rich, you should not be required to write something 
for such a common task.

regards,
Shirish.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 4:02 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


*Yes*!!  The LogManager is the ticket - I didn't know about this class, so tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I inadvertently erased the
response to this question so am not sure of its author..)

Geeta


-
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]



[OT] RE: log4j integration

2004-01-28 Thread Hookom, Jacob
I'm wondering if anyone has gotten log4j to be deployed within separate
apps?  We are having issues with log4j jars and their properties files being
deployed on each application under Weblogic.  Most of what I've read
recommends putting log4j at the container level along with a single
properties file, but that isn't as flexible as what we want it to be.

-Thanks

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Wednesday, January 28, 2004 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: log4j integration

Hi,
Also there is something called ReloadingPropertyConfigurator..May be this in
combination with HierarchyEventListener will do the trick for you.

I mean the log4j API is so feature rich, you should not be required to write
something for such a common task.

regards,
Shirish.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 4:02 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


*Yes*!!  The LogManager is the ticket - I didn't know about this class, so
tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I inadvertently
erased the
response to this question so am not sure of its author..)

Geeta


-
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]

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



RE: [OT] RE: log4j integration

2004-01-28 Thread Chappell, Simon P
Jacob,

We use log4j 1.2.8 and we include the jar file right in out WEB-INF/lib directory of 
our application. The log4j.properties file then lives inside the WEB-INF/classes 
directory. This works well for us on IBM's WAS 4.x.

I've never seen anyone recommend having log4j at the container level, so go with it at 
the application level and forget about conventional wisdom! :-)

Hope this helps.

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Java Programming Specialist  www.landsend.com
Lands' End, Inc.   (608) 935-4526

Wisdom is not the prerogative of the academics. - Peter Chappell

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 11:08 AM
To: Struts Users Mailing List
Subject: [OT] RE: log4j integration


I'm wondering if anyone has gotten log4j to be deployed within separate
apps?  We are having issues with log4j jars and their 
properties files being
deployed on each application under Weblogic.  Most of what I've read
recommends putting log4j at the container level along with a single
properties file, but that isn't as flexible as what we want it to be.

-Thanks

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]

Sent: Wednesday, January 28, 2004 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: log4j integration

Hi,
Also there is something called 
ReloadingPropertyConfigurator..May be this in
combination with HierarchyEventListener will do the trick for you.

I mean the log4j API is so feature rich, you should not be 
required to write
something for such a common task.

regards,
Shirish.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 4:02 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


*Yes*!!  The LogManager is the ticket - I didn't know about 
this class, so
tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I 
inadvertently
erased the
response to this question so am not sure of its author..)

Geeta


-
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]

-
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: [OT] RE: log4j integration

2004-01-28 Thread Kris Schneider
Yup, that should work just fine. If you want to be able to modify the config
info while the app is running (e.g. turn on debugging in production without
reloading the app), here's another approach.

Create a directory and place it on the app server's classpath. For WLS
(depending on how you do your install and create your domains), it might be
something like C:\bea8\user_projects\domains\dotech\applib.

For each app, place a unique Log4j config file in the directory. For example,
app1-log4j.xml and app2-log4j.xml.

In your app's web.xml file, include context-param or env-entry elements for
the name of the config file and the watch delay value:

env-entry
  descriptionLog4j resource file name/description
  env-entry-namelog4j/resource/env-entry-name
  env-entry-valueapp1-log4j.xml/env-entry-value
  env-entry-typejava.lang.String/env-entry-type
/env-entry

env-entry
  descriptionLog4j resource file watch delay/description
  env-entry-namelog4j/watchDelay/env-entry-name
  env-entry-value3/env-entry-value
  env-entry-typejava.lang.Long/env-entry-type
/env-entry

Finally, create a context listener (or startup servlet) to perform the
configuration:

ClassLoader cl = Thread.currentThread().getContextClassLoader();
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup(java:comp/env);

String log4jResourceName = (String)envCtx.lookup(log4j/resource);
URL log4jResourceURL = cl.getResource(log4jResourceName);
String contentType = log4jResourceURL.openConnection().getContentType();
String fileName = log4jResourceURL.getFile();

Long log4jWatchDelay = (Long)envCtx.lookup(log4j/watchDelay);
long watchDelay = log4jWatchDelay.longValue();

if (application/xml.equals(contentType)) {
  DOMConfigurator.configureAndWatch(fileName, watchDelay);
} else {
  PropertyConfigurator.configureAndWatch(fileName, watchDelay);
}

It's not so bad with some additonal help from Ant. I've also used this approach
to make it a bit less painful for multiple developers to share a single WLS
instance during development.

Quoting Chappell, Simon P [EMAIL PROTECTED]:

 Jacob,
 
 We use log4j 1.2.8 and we include the jar file right in out WEB-INF/lib
 directory of our application. The log4j.properties file then lives inside the
 WEB-INF/classes directory. This works well for us on IBM's WAS 4.x.
 
 I've never seen anyone recommend having log4j at the container level, so go
 with it at the application level and forget about conventional wisdom! :-)
 
 Hope this helps.
 
 Simon
 
 -
 Simon P. Chappell [EMAIL PROTECTED]
 Java Programming Specialist  www.landsend.com
 Lands' End, Inc.   (608) 935-4526
 
 Wisdom is not the prerogative of the academics. - Peter Chappell
 
 -Original Message-
 From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 11:08 AM
 To: Struts Users Mailing List
 Subject: [OT] RE: log4j integration
 
 
 I'm wondering if anyone has gotten log4j to be deployed within separate
 apps?  We are having issues with log4j jars and their 
 properties files being
 deployed on each application under Weblogic.  Most of what I've read
 recommends putting log4j at the container level along with a single
 properties file, but that isn't as flexible as what we want it to be.
 
 -Thanks
 
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]
 
 Sent: Wednesday, January 28, 2004 10:20 AM
 To: [EMAIL PROTECTED]
 Subject: RE: log4j integration
 
 Hi,
 Also there is something called 
 ReloadingPropertyConfigurator..May be this in
 combination with HierarchyEventListener will do the trick for you.
 
 I mean the log4j API is so feature rich, you should not be 
 required to write
 something for such a common task.
 
 regards,
 Shirish.
 
 -Original Message-
 From: Geeta Ramani [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 4:02 PM
 To: Struts Users Mailing List
 Subject: Re: log4j integration
 
 
 *Yes*!!  The LogManager is the ticket - I didn't know about 
 this class, so
 tried it
 out.  Works like a charm.. :) Thanks, Shirish (I think?  I 
 inadvertently
 erased the
 response to this question so am not sure of its author..)
 
 Geeta

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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



RE: [OT] RE: log4j integration

2004-01-28 Thread Hookom, Jacob
Thanks, we are having problems though with multiple applications (basically
I used commons-logging/log4j on a new project, then it was decided to modify
another application to also use log4j).

But it seems to create a race condition in the apps as to which
log4j.properties file actually gets used, one application logs and the other
doesn't.

The reason I believe they are conflicting is because there was a period
where both of our applications were outputting to the same log file, despite
the fact that our log4j jars were in per application scope.  It's probably
another issue with Weblogic that we're going to have to work around :-(

Thanks,
Jacob

-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 28, 2004 11:31 AM
To: Struts Users Mailing List
Subject: RE: [OT] RE: log4j integration

Jacob,

We use log4j 1.2.8 and we include the jar file right in out WEB-INF/lib
directory of our application. The log4j.properties file then lives inside
the WEB-INF/classes directory. This works well for us on IBM's WAS 4.x.

I've never seen anyone recommend having log4j at the container level, so go
with it at the application level and forget about conventional wisdom! :-)

Hope this helps.

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Java Programming Specialist  www.landsend.com
Lands' End, Inc.   (608) 935-4526

Wisdom is not the prerogative of the academics. - Peter Chappell

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 11:08 AM
To: Struts Users Mailing List
Subject: [OT] RE: log4j integration


I'm wondering if anyone has gotten log4j to be deployed within separate
apps?  We are having issues with log4j jars and their 
properties files being
deployed on each application under Weblogic.  Most of what I've read
recommends putting log4j at the container level along with a single
properties file, but that isn't as flexible as what we want it to be.

-Thanks

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]

Sent: Wednesday, January 28, 2004 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: log4j integration

Hi,
Also there is something called 
ReloadingPropertyConfigurator..May be this in
combination with HierarchyEventListener will do the trick for you.

I mean the log4j API is so feature rich, you should not be 
required to write
something for such a common task.

regards,
Shirish.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 4:02 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


*Yes*!!  The LogManager is the ticket - I didn't know about 
this class, so
tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I 
inadvertently
erased the
response to this question so am not sure of its author..)

Geeta


-
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]

-
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]

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



RE: [OT] RE: log4j integration

2004-01-28 Thread Chappell, Simon P
We do specify the log filenames in each properties file, so we don't have any 
possibility of overlap there.

We did have a problem with JRun 4 before we switched to WAS, because it came with an 
old version of log4j in it's internal library. This caused us no end of problems and 
we did have to put log4j in the server classpath to overcome the issue. This has not 
been a problem under WAS 4.x

Simon

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 11:33 AM
To: Struts Users Mailing List
Subject: RE: [OT] RE: log4j integration


Thanks, we are having problems though with multiple 
applications (basically
I used commons-logging/log4j on a new project, then it was 
decided to modify
another application to also use log4j).

But it seems to create a race condition in the apps as to which
log4j.properties file actually gets used, one application logs 
and the other
doesn't.

The reason I believe they are conflicting is because there was a period
where both of our applications were outputting to the same log 
file, despite
the fact that our log4j jars were in per application scope.  
It's probably
another issue with Weblogic that we're going to have to work around :-(

Thanks,
Jacob

-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 28, 2004 11:31 AM
To: Struts Users Mailing List
Subject: RE: [OT] RE: log4j integration

Jacob,

We use log4j 1.2.8 and we include the jar file right in out WEB-INF/lib
directory of our application. The log4j.properties file then 
lives inside
the WEB-INF/classes directory. This works well for us on IBM's WAS 4.x.

I've never seen anyone recommend having log4j at the container 
level, so go
with it at the application level and forget about conventional 
wisdom! :-)

Hope this helps.

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Java Programming Specialist  www.landsend.com
Lands' End, Inc.   (608) 935-4526

Wisdom is not the prerogative of the academics. - Peter Chappell

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 11:08 AM
To: Struts Users Mailing List
Subject: [OT] RE: log4j integration


I'm wondering if anyone has gotten log4j to be deployed 
within separate
apps?  We are having issues with log4j jars and their 
properties files being
deployed on each application under Weblogic.  Most of what I've read
recommends putting log4j at the container level along with a single
properties file, but that isn't as flexible as what we want it to be.

-Thanks

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]

Sent: Wednesday, January 28, 2004 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: log4j integration

Hi,
Also there is something called 
ReloadingPropertyConfigurator..May be this in
combination with HierarchyEventListener will do the trick for you.

I mean the log4j API is so feature rich, you should not be 
required to write
something for such a common task.

regards,
Shirish.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 4:02 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


*Yes*!!  The LogManager is the ticket - I didn't know about 
this class, so
tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I 
inadvertently
erased the
response to this question so am not sure of its author..)

Geeta


-
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]

-
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]

-
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]



log4j integration

2004-01-27 Thread shankarr
Hi!
I have integrated log4j with struts.
I need to know how to ensure that the changes done to log4j.properties file 
is taken into account at run time.
TIA,
Richie

To achieve all that is possible, one must attempt the impossible



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


log4j with struts

2004-01-27 Thread shankarr
Hi!
I am afraid I am sending this mail for the second time.
Last time, I had pasted my code for some queries and I am yet to see the post.
So here goes.
I have integred log4j with struts1.1.
I need to know how to ensure that if changes are done to log4j.properties 
file, they are taken into affect immediately?

Richie

To achieve all that is possible, one must attempt the impossible



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


[OT] Re: log4j integration

2004-01-27 Thread Guido García Bernardo
This is OT. The word struts in a message is not the only thing it 
needs to be struts related...

Try PropertyConfigurator.configureAndWatch, I think that is what you are 
searching for...
You cand find a simple example at 
http://www.jguru.com/forums/view.jsp?EID=1130416

Un saludo, chicos.
Guido.
shankarr wrote:

Hi!
I have integrated log4j with struts.
I need to know how to ensure that the changes done to log4j.properties 
file is taken into account at run time.
TIA,
Richie

To achieve all that is possible, one must attempt the impossible


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


Re: log4j integration

2004-01-27 Thread Geeta Ramani
Ritchie:

Just make sure the log4j.properties is in your class path.. (like maybe right
in your classes directory).  that should do it..

Regards,
Geeta

shankarr wrote:

 Hi!
 I have integrated log4j with struts.
 I need to know how to ensure that the changes done to log4j.properties file

 is taken into account at run time.
 TIA,
 Richie

 To achieve all that is possible, one must attempt the impossible

 -
 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 integration

2004-01-27 Thread Norm Deane
Do you mean changes made after the initial configuration of log4j?  You can
use 

PropertyConfigurator.configureAndWatch( cfgFile, delay )

This will load your log4j configuration file and create a thread that looks
for changes to the config file reloading when necessary.

--Norm

-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
[EMAIL PROTECTED] 

 -Original Message-
 From: shankarr [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, January 27, 2004 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: log4j integration
 
 
 Hi!
 I have integrated log4j with struts.
 I need to know how to ensure that the changes done to 
 log4j.properties file 
 is taken into account at run time.
 TIA,
 Richie
 
 To achieve all that is possible, one must attempt the impossible
 
 
 
 -
 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 integration

2004-01-27 Thread shankarr
Hi!

In fact, I got two responses for the question as I had sent the same 
question twice.
My mailbox was acting funny yesterday, so I had to send it twice.

Well, I do have the log4j.properties file under web-inf/classes
I had thought of using the PropertyConfigurator too.
But, when you integrate log4j with struts, we no where mention the 
log4j.properties file specifically, ie, we
just create the file and put it under the mentioned location.
And when we use it, we do not mention the log4j.properties file anywhere in 
the files too.
So, how to get a handle to the file?
Correct me if there are better approaches to the same.

Steps by which I integrated are :

a)Got the log4j.jar file
b)created the log4j.properties file
c)created commons-logging.properties file
d) used static logger = new logger(this) in the files where this is the 
class name.

TIA,

Richie



At 02:28 PM 1/27/2004 -0600, you wrote:
Do you mean changes made after the initial configuration of log4j?  You can
use
PropertyConfigurator.configureAndWatch( cfgFile, delay )

This will load your log4j configuration file and create a thread that looks
for changes to the config file reloading when necessary.
--Norm

--
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
[EMAIL PROTECTED]
 -Original Message-
 From: shankarr [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 27, 2004 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: log4j integration


 Hi!
 I have integrated log4j with struts.
 I need to know how to ensure that the changes done to
 log4j.properties file
 is taken into account at run time.
 TIA,
 Richie

 To achieve all that is possible, one must attempt the impossible



 -
 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]
To achieve all that is possible, one must attempt the impossible



[OT] Log4j configuration for EJB Project

2004-01-12 Thread Prasenjit Narwade
Hi,
   I have an application containing EJB project and a Web project. I
configured Log4j for my Web project by putting the log4j.jar in WEB-INF/lib
directory and log4j.properties in WEB-INF/classes directory.

  However I have to configure log4j for my EJB project, where should I place
the log4j.jar, log4j.properties file.


Regards,
Prasenjit   

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



about log4j - RE: Example of a non-threadsafe Action?

2003-12-23 Thread Warren Chen
Hi Craig,

Continue with the thread safe issue:

how about Log class? I understand that log4j itself is
thread safe (unlike DateFormat) - but I see a lot
examples that log4j logs are used as instance varibale

public final class MyAction
{
private Log log = 
LogFactory.getLog(this.getClass().getName());
public ActionForward execute(.)
{.}
}

Is this thread safe?

If yes, then even we use instance variable, as long as
we access it thread-safe way (ie. sync it), it will be
ok, right? (performance is another issue)

Thanks a lot!

Warren

--- Craig R. McClanahan [EMAIL PROTECTED] wrote:
 Quoting Nifty Music [EMAIL PROTECTED]:
 
  Thanks Craig!  You certainly confirmed my
 suspicions, although I would have
  guessed that I could've gotten away with sharing
 the SimpleDateFormat
  variable since it wouldn't depend on any values
 coming in from request
  objects.  Could you perhaps shed some light on why
 it wouldn't make sense to
  share it?
  
 
 Because the internal implementation of
 SimpleDateFormat uses instance variables
 during parsing and formatting, so it's not thread
 safe :-).
 
 Craig
 
 

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



Re: about log4j - RE: Example of a non-threadsafe Action?

2003-12-23 Thread Craig R. McClanahan
Quoting Warren Chen [EMAIL PROTECTED]:

 Hi Craig,
 
 Continue with the thread safe issue:
 
 how about Log class? I understand that log4j itself is
 thread safe (unlike DateFormat) - but I see a lot
 examples that log4j logs are used as instance varibale
 
 public final class MyAction
 {
 private Log log = 
 LogFactory.getLog(this.getClass().getName());
 public ActionForward execute(.)
 {.}
 }
 

I tend to make my log variables static as well, but that doesn't change
whether it's threadsafe or not -- it just reduces the number of object
creations that happen if there's more than one instance of my class being
created.

 Is this thread safe?
 

If the commons-logging implementation classes for the wrapper are threadsafe
(and they are), and the underlying logging implementation claims to be
threadsafe (as do Log4J, JDK 1.4 logging, and the SimpleLog implementation --
don't know about the others) than this is indeed threadsafe.

 If yes, then even we use instance variable, as long as
 we access it thread-safe way (ie. sync it), it will be
 ok, right? (performance is another issue)
 

If an object is threadsafe, it should be unnecessary for you to synchronize at
all -- any required synchronzation must already be occurring inside.  For
example, consider the difference between java.util.Hashtable (which advertises
itself as threadsafe) and java.util.HashMap (which explicitly states that it is
*not* threadsafe).  The get() and put() calls never need to be synchronized in
the former case (even if you store the Hashtable in an instance variable of an
Action, because the class does its own synchronization internally.  The
opposite is true if you create a HashMap and make it accessible from more than
one thread.

For example, note that you won't see any synchronization around calls like
log.debug() or log.trace() in the Struts code.  Because the Log instance is
threadsafe, I don't need to worry about the fact that there might be two
simultaneous calls to log.debug() on different threads, processing different
requests.

In a similar vein, your servlet container guarantees that calls to
HttpSession.getAttribute() and HttpSession.setAttribute(), for example, are
thread safe ... in the sense that accessing attributes from more than one
thread will not corrupt the internal data structure that the servlet container
is using to keep track of attributes for you.  You are still on the hook, of
course, to guarantee that the objects you store as attributes are thread safe,
but that's the application's issue, not the container's issue.

Does that help?

 Thanks a lot!
 
 Warren

Craig


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



Re: about log4j - RE: Example of a non-threadsafe Action?

2003-12-23 Thread Warren Chen
Craig, Thanks a lot! no more questions! so glad to
know that my understandings are correct.

is there a duke dollar thing we can use here :) ?

Happy Holidays!


--- Craig R. McClanahan [EMAIL PROTECTED] wrote:
 Quoting Warren Chen [EMAIL PROTECTED]:
 
  Hi Craig,
  
  Continue with the thread safe issue:
  
  how about Log class? I understand that log4j
 itself is
  thread safe (unlike DateFormat) - but I see a lot
  examples that log4j logs are used as instance
 varibale
  
  public final class MyAction
  {
  private Log log = 
  LogFactory.getLog(this.getClass().getName());
  public ActionForward execute(.)
  {.}
  }
  
 
 I tend to make my log variables static as well,
 but that doesn't change
 whether it's threadsafe or not -- it just reduces
 the number of object
 creations that happen if there's more than one
 instance of my class being
 created.
 
  Is this thread safe?
  
 
 If the commons-logging implementation classes for
 the wrapper are threadsafe
 (and they are), and the underlying logging
 implementation claims to be
 threadsafe (as do Log4J, JDK 1.4 logging, and the
 SimpleLog implementation --
 don't know about the others) than this is indeed
 threadsafe.
 
  If yes, then even we use instance variable, as
 long as
  we access it thread-safe way (ie. sync it), it
 will be
  ok, right? (performance is another issue)
  
 
 If an object is threadsafe, it should be unnecessary
 for you to synchronize at
 all -- any required synchronzation must already be
 occurring inside.  For
 example, consider the difference between
 java.util.Hashtable (which advertises
 itself as threadsafe) and java.util.HashMap (which
 explicitly states that it is
 *not* threadsafe).  The get() and put() calls never
 need to be synchronized in
 the former case (even if you store the Hashtable in
 an instance variable of an
 Action, because the class does its own
 synchronization internally.  The
 opposite is true if you create a HashMap and make it
 accessible from more than
 one thread.
 
 For example, note that you won't see any
 synchronization around calls like
 log.debug() or log.trace() in the Struts code. 
 Because the Log instance is
 threadsafe, I don't need to worry about the fact
 that there might be two
 simultaneous calls to log.debug() on different
 threads, processing different
 requests.
 
 In a similar vein, your servlet container guarantees
 that calls to
 HttpSession.getAttribute() and
 HttpSession.setAttribute(), for example, are
 thread safe ... in the sense that accessing
 attributes from more than one
 thread will not corrupt the internal data structure
 that the servlet container
 is using to keep track of attributes for you.  You
 are still on the hook, of
 course, to guarantee that the objects you store as
 attributes are thread safe,
 but that's the application's issue, not the
 container's issue.
 
 Does that help?
 
  Thanks a lot!
  
  Warren
 
 Craig
 
 

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



Re: Log4J

2003-12-10 Thread Kwok Peng Tuck
It says no class definition found rather than no class found, are you 
initializing the class correctly ?
Sathish Babu K R wrote:

hi kalra

yep i have that log4j in lib folder

sathish

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
-
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

2003-12-10 Thread Sathish Babu K R
hi kwok

how to initialize the class

what am i doing is 

i m having loggers.java as

package com.pronto.util;

import java.io.*;
import java.util.*;
import org.apache.log4j.*;

/**
 * Title:
 * Description:  Uses new Log4j class to log all the
message to a file
 * Copyright:Copyright (c) 2003
 * Company:
 * @author Sathish Babu
 * @version 1.0
 */

public class Loggers {

  public static int DEBUG_LOG_LEVEL = 1;
  public static int INFO_LOG_LEVEL = 2;
  public static int ERROR_LOG_LEVEL = 4;

  private static PrintWriter _printWriter = null;
  private static String _logFile = null;
  private static int _logLevel;
  private static Logger logger =
Logger.getLogger(com.pronto.web);

  public static TreeMap levels = new TreeMap();
  static {
levels.put(String.valueOf(DEBUG_LOG_LEVEL),
DEBUG);
levels.put(String.valueOf(INFO_LOG_LEVEL),
INFO);
levels.put(String.valueOf(ERROR_LOG_LEVEL),
ERROR);
_logLevel = logger.getLevel().toInt();
ConsoleAppender app
=(ConsoleAppender)logger.getAppender(Log);
   // RollingFileAppender app
=(RollingFileAppender)logger.getAppender(Log);
   // _logFile = app.getFile();
  }

  public synchronized static void logMessage(Object
message, int logLevel) {
  System.out.println(got into log message);
/*if(logLevel == ERROR_LOG_LEVEL)
  {
  logger.error(message);
  }
else if(logLevel == INFO_LOG_LEVEL)
  {
  logger.info(message);
  }
else
  {*/
System.out.println(got into debug message);
  logger.debug(message);
  //}
  }

  public static void setLoggingLevel(int level) {
if( logger.getLevel().toInt() != level ) {
  if(level == DEBUG_LOG_LEVEL)
logger.setLevel(Level.DEBUG);
  if(level == INFO_LOG_LEVEL)
logger.setLevel(Level.INFO);
  if(level == ERROR_LOG_LEVEL)
logger.setLevel(Level.ERROR);
  logMessage(Setting logging level to  +
levels.get(String.valueOf(level)), level);
}
  }

  public static void clearLogFile()  {
try {
  if(_printWriter != null)
_printWriter.close();
  _printWriter = new PrintWriter(new
FileWriter(_logFile), true);
  logMessage(Cleared out logfile,
logger.getLevel().toInt());
}
catch(Exception e) {
  logMessage(Error while Clearing logfile
+e.getMessage(), ERROR_LOG_LEVEL);
}
  }

  public static void writeFileToWriter(Writer out) {
try {
  BufferedReader br = new BufferedReader(new
FileReader(_logFile));
  char[] buff = new char[2048];
  int bytesRead;

  while(-1 != (bytesRead = br.read(buff, 0,
buff.length))) {
out.write(buff, 0, bytesRead);
  }
  br.close();
}
catch(Exception e) {
  Loggers.logMessage(Error while writing the file
to writer  +e.getMessage(),ERROR_LOG_LEVEL);
}
  }

  public static int getLoggingLevel() {
return _logLevel;
  }

  private Loggers() {
  }
  public static void main(String[] args) 
{
System.out.println(Hello World!);
Loggers.logMessage(stupid..idiot,
Loggers.ERROR_LOG_LEVEL);
}
}


i m calling that in actionform class as 

Loggers.logMessage(stupid..idiot,
Loggers.DEBUG_LOG_LEVEL);

tell me solution

sathish

--- Kwok Peng Tuck [EMAIL PROTECTED] wrote:
 It says no class definition found rather than no
 class found, are you 
 initializing the class correctly ?
 Sathish Babu K R wrote:
 
 hi kalra
 
 yep i have that log4j in lib folder
 
 sathish
 
 __
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing.
 http://photos.yahoo.com/
 

-
 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]
 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: Log4J

2003-12-10 Thread alan
The Category class has been deprecated and they talked about taking it
out of the distribution after mid 2003 (according to the javadocs).  Try
using Logger instead.  Not sure if this is your problem but it's still a
good idea to switch over to the Logger class and if you're using a
hyper-uptodate jar then it might do the trick...

alan

-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 09, 2003 10:53 PM
To: Struts Users Mailing List
Subject: RE: Log4J 

hi kalra

yep i have that log4j in lib folder

sathish

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-
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

2003-12-10 Thread Sathish Babu K R
hi alan

i don't use category class at all

then how come its showing errori don't get it...

whatz that jar that makes trick?tell me

sathish

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: Log4J

2003-12-10 Thread Kalra, Ashwani
from the code you sent , there doesnt seem to be any problem.

i don't use category class at all

then how come its showing errori don't get it...

Some classes internally still uses this class. They will finally be removed.

Check to see that Category class (org/apache/log4j/Category) is indeed
present in you jar. 

one more check 
Where are your com.pronto.web.AccessSummaryReportForm class lying ?










-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 12:38 PM
To: Struts Users Mailing List
Subject: RE: Log4J 


hi alan

i don't use category class at all

then how come its showing errori don't get it...

whatz that jar that makes trick?tell me

sathish

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst  Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.

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



RE: Log4J

2003-12-10 Thread Sathish Babu K R
hi kalra

com.pronto.web.accesssummaryreportform is in
web-inf/classes

will there be any probs due to log4j.prop..its as

log4j.rootLogger=ALL ,Log
log4j.appender.Log=org.apache.log4j.ConsoleAppender
log4j.appender.Log.layout=org.apache.log4j.PatternLayout
log4j.appender.Log.layout.ConversionPattern=%d{dd MMM
yyy HH:mm:ss,SSS} %-5p %c - %m%n

# Define the type of logger
#log4j.appender.Log=org.apache.log4j.RollingFileAppender
#log4j.appender.Log.File=logs/dbcube.log
#log4j.appender.Log.MaxFileSize=1KB

# Keep one backup file
#log4j.appender.Log.MaxBackupIndex=1

# Define the stuff to log
#log4j.appender.Log.layout=org.apache.log4j.PatternLayout
#log4j.appender.Log.layout.ConversionPattern=%d{dd MMM
yyy HH:mm:ss,SSS} %-5p %c - %m%n

#log4j.logger.dbcube=ALL, Log


regards
sathish
--- Kalra, Ashwani [EMAIL PROTECTED] wrote:
 from the code you sent , there doesnt seem to be any
 problem.
 
 i don't use category class at all
 
 then how come its showing errori don't get
 it...
 
 Some classes internally still uses this class. They
 will finally be removed.
 
 Check to see that Category class
 (org/apache/log4j/Category) is indeed
 present in you jar. 
 
 one more check 
 Where are your
 com.pronto.web.AccessSummaryReportForm class lying ?
 
 
 
 
 
 
 
 
 
 
 -Original Message-
 From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 10, 2003 12:38 PM
 To: Struts Users Mailing List
 Subject: RE: Log4J 
 
 
 hi alan
 
 i don't use category class at all
 
 then how come its showing errori don't get
 it...
 
 whatz that jar that makes trick?tell me
 
 sathish
 
 __
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing.
 http://photos.yahoo.com/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 This message contains information that may be
 privileged or confidential and
 is the property of the Cap Gemini Ernst  Young
 Group. It is intended only
 for the person to whom it is addressed. If you are
 not the intended
 recipient, you are not authorised to read, print,
 retain, copy, disseminate,
 distribute, or use this message or any part thereof.
 If you receive this
 message in error, please notify the sender
 immediately and delete all copies
 of this message.
 

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: Log4J

2003-12-10 Thread Kalra, Ashwani
I dont see any problem here.Only thing is that your property file should be
present in classpath somewhere. may be in web-inf\classes.  Also check the
req category class is present in jar file. and no other log4.jar is present
in your classpath.





-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 12:47 PM
To: Struts Users Mailing List
Subject: RE: Log4J 


hi kalra

com.pronto.web.accesssummaryreportform is in
web-inf/classes

will there be any probs due to log4j.prop..its as

log4j.rootLogger=ALL ,Log
log4j.appender.Log=org.apache.log4j.ConsoleAppender
log4j.appender.Log.layout=org.apache.log4j.PatternLayout
log4j.appender.Log.layout.ConversionPattern=%d{dd MMM
yyy HH:mm:ss,SSS} %-5p %c - %m%n

# Define the type of logger
#log4j.appender.Log=org.apache.log4j.RollingFileAppender
#log4j.appender.Log.File=logs/dbcube.log
#log4j.appender.Log.MaxFileSize=1KB

# Keep one backup file
#log4j.appender.Log.MaxBackupIndex=1

# Define the stuff to log
#log4j.appender.Log.layout=org.apache.log4j.PatternLayout
#log4j.appender.Log.layout.ConversionPattern=%d{dd MMM
yyy HH:mm:ss,SSS} %-5p %c - %m%n

#log4j.logger.dbcube=ALL, Log


regards
sathish
--- Kalra, Ashwani [EMAIL PROTECTED] wrote:
 from the code you sent , there doesnt seem to be any
 problem.
 
 i don't use category class at all
 
 then how come its showing errori don't get
 it...
 
 Some classes internally still uses this class. They
 will finally be removed.
 
 Check to see that Category class
 (org/apache/log4j/Category) is indeed
 present in you jar. 
 
 one more check 
 Where are your
 com.pronto.web.AccessSummaryReportForm class lying ?
 
 
 
 
 
 
 
 
 
 
 -Original Message-
 From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 10, 2003 12:38 PM
 To: Struts Users Mailing List
 Subject: RE: Log4J 
 
 
 hi alan
 
 i don't use category class at all
 
 then how come its showing errori don't get
 it...
 
 whatz that jar that makes trick?tell me
 
 sathish
 
 __
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing.
 http://photos.yahoo.com/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 This message contains information that may be
 privileged or confidential and
 is the property of the Cap Gemini Ernst  Young
 Group. It is intended only
 for the person to whom it is addressed. If you are
 not the intended
 recipient, you are not authorised to read, print,
 retain, copy, disseminate,
 distribute, or use this message or any part thereof.
 If you receive this
 message in error, please notify the sender
 immediately and delete all copies
 of this message.
 

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst  Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.

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



RE: Log4J

2003-12-10 Thread Sathish Babu K R
hi kalra

everything is fine in respective classpaths

sathish
--- Kalra, Ashwani [EMAIL PROTECTED] wrote:
 I dont see any problem here.Only thing is that your
 property file should be
 present in classpath somewhere. may be in
 web-inf\classes.  Also check the
 req category class is present in jar file. and no
 other log4.jar is present
 in your classpath.
 
 
 
 
 
 -Original Message-
 From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 10, 2003 12:47 PM
 To: Struts Users Mailing List
 Subject: RE: Log4J 
 
 
 hi kalra
 
 com.pronto.web.accesssummaryreportform is in
 web-inf/classes
 
 will there be any probs due to log4j.prop..its as
 
 log4j.rootLogger=ALL ,Log
 log4j.appender.Log=org.apache.log4j.ConsoleAppender

log4j.appender.Log.layout=org.apache.log4j.PatternLayout
 log4j.appender.Log.layout.ConversionPattern=%d{dd
 MMM
 yyy HH:mm:ss,SSS} %-5p %c - %m%n
 
 # Define the type of logger

#log4j.appender.Log=org.apache.log4j.RollingFileAppender
 #log4j.appender.Log.File=logs/dbcube.log
 #log4j.appender.Log.MaxFileSize=1KB
 
 # Keep one backup file
 #log4j.appender.Log.MaxBackupIndex=1
 
 # Define the stuff to log

#log4j.appender.Log.layout=org.apache.log4j.PatternLayout
 #log4j.appender.Log.layout.ConversionPattern=%d{dd
 MMM
 yyy HH:mm:ss,SSS} %-5p %c - %m%n
 
 #log4j.logger.dbcube=ALL, Log
 
 
 regards
 sathish
 --- Kalra, Ashwani [EMAIL PROTECTED]
 wrote:
  from the code you sent , there doesnt seem to be
 any
  problem.
  
  i don't use category class at all
  
  then how come its showing errori don't get
  it...
  
  Some classes internally still uses this class.
 They
  will finally be removed.
  
  Check to see that Category class
  (org/apache/log4j/Category) is indeed
  present in you jar. 
  
  one more check 
  Where are your
  com.pronto.web.AccessSummaryReportForm class
 lying ?
  
  
  
  
  
  
  
  
  
  
  -Original Message-
  From: Sathish Babu K R
 [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 10, 2003 12:38 PM
  To: Struts Users Mailing List
  Subject: RE: Log4J 
  
  
  hi alan
  
  i don't use category class at all
  
  then how come its showing errori don't get
  it...
  
  whatz that jar that makes trick?tell me
  
  sathish
  
  __
  Do you Yahoo!?
  New Yahoo! Photos - easier uploading and
 sharing.
  http://photos.yahoo.com/
  
 

-
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
 
  This message contains information that may be
  privileged or confidential and
  is the property of the Cap Gemini Ernst  Young
  Group. It is intended only
  for the person to whom it is addressed. If you
 are
  not the intended
  recipient, you are not authorised to read, print,
  retain, copy, disseminate,
  distribute, or use this message or any part
 thereof.
  If you receive this
  message in error, please notify the sender
  immediately and delete all copies
  of this message.
  
 

-
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing.
 http://photos.yahoo.com/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 This message contains information that may be
 privileged or confidential and
 is the property of the Cap Gemini Ernst  Young
 Group. It is intended only
 for the person to whom it is addressed. If you are
 not the intended
 recipient, you are not authorised to read, print,
 retain, copy, disseminate,
 distribute, or use this message or any part thereof.
 If you receive this
 message in error, please notify the sender
 immediately and delete all copies
 of this message.
 

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



Re: [OT] Log4J and Pre-Processor

2003-12-10 Thread Kirk Wylie
Tim Lucia wrote:

Would you rather have that 5ns, or the ace-in-the-hole where you can
debug your app in an installed production environment by turning on
(assuming you don't use the final static boolean method) the appropriate
logger?  This has been extremely helpful in debugging.  It also catches
lots of things you wouldn't ordinarily see, like when you add this to an
ActionListener more then once and you see your actionPerformed() get
called more then once.  It's also useful for profiling.
I think my original email should make it abundantly clear on which side 
_I_ fall on this issue. :-)

In fact, I've been known to (gasp! horror!) deploy applications into 
production with -g enabled in order to be able to actually turn on 
with java debugging enabled and remote debug the application (on an 
unactive node, of course) in the production environment. I've heard of 
people who just start their app servers with JDWP enabled all the time 
for this reason, but I've never actually met one. :-)

In short, I've found that trying to save micro-amounts of time here and 
there in an application at the expense of debuggability and 
maintainability usually end up with a bad application that's also slow. 
Java enterprise/web applications are so seldom, in my experience, 
performance limited by the actual Java bytecode execution speed, as to 
make optimizing for that virtually irrelevant. There are so many other 
places to start optimizing rather than worrying about 5ns here and 5ns 
there, particularly before you go into production and know that you 
aren't suitably performant.

Kirk Wylie
M7 Corporation
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[OT] Log4J and Pre-Processor

2003-12-09 Thread Tolle Krez
Sorry for an off-topic post. I hope I will get an answer since this is a very active
mailing list.

I am using Log4J for logging in my current project with too many logging statements.  I
wrap every logging statements with the  isDebugEnabled(), isWarnEnabled(), etc.  During
production , the logging level will be set to very minimum, and only critical errors 
will
be logged.  But however,  the boolean comparison statements (whether or not to log) 
will
be executed, which we feel will have a performance impact.

I would like to know if  it is a good idea to pre-process the java code to remove all 
the
logging statements and then create the binary?? or to begin with, limit the number of
logging statements during the development process itself?? If pre-processing the source
code to find and remove logging statements.. is a better option, then can some one 
point
me to a good java pre processor?

Thanks in Advance.




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



Re: [OT] Log4J and Pre-Processor

2003-12-09 Thread Ted Husted
You might first run some load tests to see if the boolean statements do 
have a non-negligable performance impact. It's easy to loose something 
like this in the rounding, and there may be better places to spend your 
optimization dollars. As scientists, we should should more than feel, 
we should know.

Tolle Krez wrote:
Sorry for an off-topic post. I hope I will get an answer since this is a very active
mailing list.
I am using Log4J for logging in my current project with too many logging statements.  I
wrap every logging statements with the  isDebugEnabled(), isWarnEnabled(), etc.  During
production , the logging level will be set to very minimum, and only critical errors 
will
be logged.  But however,  the boolean comparison statements (whether or not to log) 
will
be executed, which we feel will have a performance impact.
I would like to know if  it is a good idea to pre-process the java code to remove all 
the
logging statements and then create the binary?? or to begin with, limit the number of
logging statements during the development process itself?? If pre-processing the source
code to find and remove logging statements.. is a better option, then can some one 
point
me to a good java pre processor?
Thanks in Advance.



-
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: [OT] Log4J and Pre-Processor

2003-12-09 Thread Derek Clarkson
Of course having any extra statements in a program is going to cost in terms 
of CPU time. The questions is how much. I have seen simple removeal of code, 
as well as addition of code make massive differences to the time it costs to 
run something. I have also seem it make no visible difference as well. The 
trick is to run it both before and after the code changes so that you can 
measure how big a change it is. 

I would suggest do a run with the logging code in, and then one without. If 
the difference is not great, then leave the code in as you never know when 
you will need it. If there is a large difference then you have to decide how 
important it really is.

cio
Derek.

On Wednesday 10 December 2003 10:17, Tolle Krez wrote:
 Sorry for an off-topic post. I hope I will get an answer since this is a
 very active mailing list.

 I am using Log4J for logging in my current project with too many logging
 statements.  I wrap every logging statements with the  isDebugEnabled(),
 isWarnEnabled(), etc.  During production , the logging level will be set to
 very minimum, and only critical errors will be logged.  But however,  the
 boolean comparison statements (whether or not to log) will be executed,
 which we feel will have a performance impact.

 I would like to know if  it is a good idea to pre-process the java code to
 remove all the logging statements and then create the binary?? or to begin
 with, limit the number of logging statements during the development process
 itself?? If pre-processing the source code to find and remove logging
 statements.. is a better option, then can some one point me to a good java
 pre processor?

 Thanks in Advance.




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

-- 
Regards,
Derek Clarkson

.O. Analyst/Programmer
..O Waterwerks Pty Ltd
OOO Melbourne, Australia


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



Re: [OT] Log4J and Pre-Processor

2003-12-09 Thread Kirk Wylie
Tolle Krez wrote:

I am using Log4J for logging in my current project with too many logging 
statements.  I
wrap every logging statements with the  isDebugEnabled(), 
isWarnEnabled(), etc.  During
production , the logging level will be set to very minimum, and only 
critical errors will
be logged.  But however,  the boolean comparison statements (whether or 
not to log) will
be executed, which we feel will have a performance impact.
You're probably wrong.

http://jakarta.apache.org/log4j/docs/index.html

Their benchmark is 5nanoseconds to do that method call to determine if a 
particular logging level is enabled. If you're THAT concerned about 5ns, 
your program probably has such hard performance requirements that you 
designed first around performance to begin with, no?

I would like to know if  it is a good idea to pre-process the java code 
to remove all the
logging statements and then create the binary?? or to begin with, limit 
the number of
logging statements during the development process itself?? If 
pre-processing the source
code to find and remove logging statements.. is a better option, then 
can some one point
me to a good java pre processor?
Don't bother. For this, you can rely on public static final boolean 
member variables.

Basically, if you compile with any type of optimization on, any call 
that is like this:
if(false) {
}
will be optimized away entirely (i.e. the bytecodes won't even appear in 
the .class file at all). That also flows through variables:
public class Debug {
	public static final boolean DEBUG_LEVEL = false;
}
public class Foobar {
	public void doStuff() {
		if(Debug.DEBUG_LEVEL) {
			// This can never happen and won't
			// be in the bytecodes.
		}
	}
}
So if you care THAT much about 5ns per call, do it this way (through 
compilation) and let the java compiler do the work for you. For this, 
even if you decide to pre-process, you don't have to pre-process.

But do you really care that much about 5ns? Are you SURE you care that 
much about 5ns?

Kirk Wylie
M7 Corporation
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [OT] Log4J and Pre-Processor

2003-12-09 Thread Tim Lucia
Would you rather have that 5ns, or the ace-in-the-hole where you can
debug your app in an installed production environment by turning on
(assuming you don't use the final static boolean method) the appropriate
logger?  This has been extremely helpful in debugging.  It also catches
lots of things you wouldn't ordinarily see, like when you add this to an
ActionListener more then once and you see your actionPerformed() get
called more then once.  It's also useful for profiling.

The biggest savings with if (logger.isDebugEnabled()) { } comes when the
logger generates lots of StringBuffer objects, costing memory and
garbage collection, which will significantly impact performance more
then the if () to check whether to do it or not.

Tim Lucia

 -Original Message-
 From: Kirk Wylie [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 09, 2003 7:20 PM
 To: Struts Users Mailing List
 Subject: Re: [OT] Log4J and Pre-Processor

 [snip]
 But do you really care that much about 5ns? Are you SURE you 
 care that 
 much about 5ns?
 



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



RE: [OT] Log4J and Pre-Processor

2003-12-09 Thread Edgar P Dollin
The difference between scientists and engineers

The funny part is they are both right.  The hard part is deciding
which you are and living with the decision.

Edgar

 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED] 

 You might first run some load tests to see if the boolean statements do 
 have a non-negligable performance impact. It's easy to loose something 
 like this in the rounding, and there may be better places to spend your 
 optimization dollars. As scientists, we should should more than feel, 
 we should know.


 -Original Message-
 From: Kirk Wylie [mailto:[EMAIL PROTECTED] 

 So if you care THAT much about 5ns per call, do it this way (through 
 compilation) and let the java compiler do the work for you. For this, 
 even if you decide to pre-process, you don't have to pre-process.
 
 But do you really care that much about 5ns? Are you SURE you 
 care that 
 much about 5ns?
 
 Kirk Wylie
 M7 Corporation
 

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



Log4J

2003-12-09 Thread Sathish Babu K R
hi all

i m getting this error...

java.lang.NoClassDefFoundError:
org/apache/log4j/Category
at
com.pronto.web.AccessSummaryReportForm.validate(Unknown
Source)
at
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2106)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1565)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at
oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:602)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:308)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:779)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:484)


pls tell me y?

sathish


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: Log4J

2003-12-09 Thread Kalra, Ashwani

Do you have log4j.jar in web-inf\lib dir  ?




-Original Message-
From: Sathish Babu K R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 12:16 PM
To: Struts Users Mailing List
Subject: Log4J 


hi all

i m getting this error...

java.lang.NoClassDefFoundError:
org/apache/log4j/Category
   at
com.pronto.web.AccessSummaryReportForm.validate(Unknown
Source)
   at
org.apache.struts.action.ActionServlet.processValidate(ActionSe
rvlet.java:2106)
   at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1565)
   at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
   at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterCh
ain.java:65)
   at
oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(ServletReques
tDispatcher.java:602)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forwardInternal(Serv
letRequestDispatcher.java:308)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequest
Handler.java:779)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
   at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for
J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(Releas
ableResourcePooledExecutor.java:192)
   at java.lang.Thread.run(Thread.java:484)


pls tell me y?

sathish


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst  Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.

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



RE: Log4J

2003-12-09 Thread Sathish Babu K R
hi kalra

yep i have that log4j in lib folder

sathish

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



Re: Log4j with Struts

2003-12-05 Thread Rahul Mohan
hi nick,

thanks for responding...its the logger class thats missing ithink...
this is the exception i get when i try to view the page:

java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at app.LogonAction.perform(Unknown Source)


what could be the problem? please excuse my novice level...

thanks again..


- Original Message -
From: Nick Faiz [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, December 05, 2003 12:22 PM
Subject: RE: Log4j with Struts


 Well, what class can't it find, the Logger or the LogonAction.class ?

 I use it with Struts, without a hassle, on WebLogic 7.2.

 Nick

 -Original Message-
 From: Rahul Mohan [mailto:[EMAIL PROTECTED]
 Sent: Friday, 5 December 2003 5:46 PM
 To: struts
 Subject: Log4j with Struts

 Hi,

 has anybody tried using Log4j with struts? I tried the following code
 and its giving a ClassDefNotFoundException during runtime..

 this is inside the perform method:
  String str = new String(LogonAction.class.getName()); //LogonAction
is
 an Action Class
  logger = Logger.getLogger(str); //this line is throwing the
exception -
 apparently str is not having a classdef

 somebody please help me with this.or is there any other method to
 perform logging?

 i am using tomcat4.1 ...

 Thanks in advance.

 Rahul Mohan
 ~~~
 MasterCraft Group
 Tata Consultancy Services
 Tata Research Development and Design Center
 54B, Hadapsar Industrial Estate
 Pune - 411 013
 Phone: +91 4042333 or 4031122 Extn 2556
 +91 20 31544082 ( Mobile )
 Fax: +91 20 4042399
 email : [EMAIL PROTECTED]
 ~~~

 -
 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 with Struts

2003-12-05 Thread Nick Faiz
Hey Rahul,
Ensure that log4j is included on the classpath of your server. 
If you get stuck, simply punch ` java.lang.NoClassDefFoundError:
org/apache/log4j/Logger' into a google search or read through the doc.s. 

Nick.

-Original Message-
From: Rahul Mohan [mailto:[EMAIL PROTECTED] 
Sent: Friday, 5 December 2003 5:57 PM
To: Struts Users Mailing List
Subject: Re: Log4j with Struts

hi nick,

thanks for responding...its the logger class thats missing ithink...
this is the exception i get when i try to view the page:

java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at app.LogonAction.perform(Unknown Source)


what could be the problem? please excuse my novice level...

thanks again..


- Original Message -
From: Nick Faiz [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, December 05, 2003 12:22 PM
Subject: RE: Log4j with Struts


 Well, what class can't it find, the Logger or the LogonAction.class ?

 I use it with Struts, without a hassle, on WebLogic 7.2.

 Nick

 -Original Message-
 From: Rahul Mohan [mailto:[EMAIL PROTECTED]
 Sent: Friday, 5 December 2003 5:46 PM
 To: struts
 Subject: Log4j with Struts

 Hi,

 has anybody tried using Log4j with struts? I tried the following code
 and its giving a ClassDefNotFoundException during runtime..

 this is inside the perform method:
  String str = new String(LogonAction.class.getName()); //LogonAction
is
 an Action Class
  logger = Logger.getLogger(str); //this line is throwing the
exception -
 apparently str is not having a classdef

 somebody please help me with this.or is there any other method to
 perform logging?

 i am using tomcat4.1 ...

 Thanks in advance.

 Rahul Mohan
 ~~~
 MasterCraft Group
 Tata Consultancy Services
 Tata Research Development and Design Center
 54B, Hadapsar Industrial Estate
 Pune - 411 013
 Phone: +91 4042333 or 4031122 Extn 2556
 +91 20 31544082 ( Mobile )
 Fax: +91 20 4042399
 email : [EMAIL PROTECTED]
 ~~~

 -
 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]

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



Re: Log4j with Struts

2003-12-05 Thread Pedro Salgado

Do you have the log4j jar on the WEB-INF/lib?
Do you have the log4j.properties on the WEB-INF/classes?

You have:
String str = new String(LogonAction.class.getName());
Logger logger = Logger.getLogger(str);

Shouldn't it be:
Logger logger = Logger.getLogger(LogonAction.class);


Pedro Salgado

On 05/12/2003 06:56, Rahul Mohan [EMAIL PROTECTED] wrote:

 hi nick,
 
 thanks for responding...its the logger class thats missing ithink...
 this is the exception i get when i try to view the page:
 
   java.lang.NoClassDefFoundError: org/apache/log4j/Logger
   at app.LogonAction.perform(Unknown Source)
   
 
 what could be the problem? please excuse my novice level...
 
 thanks again..
 
 
 - Original Message -
 From: Nick Faiz [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Friday, December 05, 2003 12:22 PM
 Subject: RE: Log4j with Struts
 
 
 Well, what class can't it find, the Logger or the LogonAction.class ?
 
 I use it with Struts, without a hassle, on WebLogic 7.2.
 
 Nick
 
 -Original Message-
 From: Rahul Mohan [mailto:[EMAIL PROTECTED]
 Sent: Friday, 5 December 2003 5:46 PM
 To: struts
 Subject: Log4j with Struts
 
 Hi,
 
 has anybody tried using Log4j with struts? I tried the following code
 and its giving a ClassDefNotFoundException during runtime..
 
 this is inside the perform method:
  String str = new String(LogonAction.class.getName()); //LogonAction
 is
 an Action Class
  logger = Logger.getLogger(str); //this line is throwing the
 exception -
 apparently str is not having a classdef
 
 somebody please help me with this.or is there any other method to
 perform logging?
 
 i am using tomcat4.1 ...
 
 Thanks in advance.
 
 Rahul Mohan
 ~~~
 MasterCraft Group
 Tata Consultancy Services
 Tata Research Development and Design Center
 54B, Hadapsar Industrial Estate
 Pune - 411 013
 Phone: +91 4042333 or 4031122 Extn 2556
 +91 20 31544082 ( Mobile )
 Fax: +91 20 4042399
 email : [EMAIL PROTECTED]
 ~~~
 
 -
 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]


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



Re: Log4j with Struts

2003-12-05 Thread James Mitchell
On Fri, 5 Dec 2003, Pedro Salgado wrote:


 Do you have the log4j jar on the WEB-INF/lib?
 Do you have the log4j.properties on the WEB-INF/classes?

 You have:
 String str = new String(LogonAction.class.getName());
 Logger logger = Logger.getLogger(str);

 Shouldn't it be:
 Logger logger = Logger.getLogger(LogonAction.class);

Not sure if this was mentioned, but you should configure your app to use
commons-logging and then specify in its configuration to use Log4j.  That
way you can swap out logging implementations by simple configuration and
library addtions/removal (no recompile necessary).

What I do it this:
under /WEB-INF/classes
 - commons-logging.properties

#
# Directly selects log4j logging implementation class.
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory

# 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.Log4JCategoryLog


 - log4j.properties

# Set the root logger level to DEBUG and its only appender to rolling

log4j.rootLogger=WARN, rolling, stdout

# Set the logger level for everything under org.apache to WARN
log4j.logger.org.apache=WARN
log4j.logger.com.company.framework.common.util.ApplicationConfig=WARN

# Set the logger level for org.apache.commons.validator.ValidatorUtil to
# FATAL because we know that errors will be generated here that we want to
# ignore (due to the fact that it is unknown whether a consumer is
personal
# or business and the validation.xml file is not set up to accomodate the
# differences)

log4j.logger.org.apache.commons.validator.ValidatorUtil=FATAL
log4j.logger.org.apache.log4j.TextLogger=INFO


# Configure the stdout appender to be a ConsoleAppender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender

# Configure the stdout appender to use the PatternLayout
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Configure the conversion pattern for the stdout appender
log4j.appender.stdout.layout.ConversionPattern=%d - %p %c - %m%n

# Configure the rolling appender to be a RollingFileAppender
log4j.appender.rolling=org.apache.log4j.RollingFileAppender

# Configure the name of the log file for the rolling appender
log4j.appender.rolling.File=/path/to/log/files/ldapAdminWeb.log

# Configure the maximum size of the log file for the rolling appender
#log4j.appender.rolling.MaxFileSize=4MB

# Keep one backup file of the rolling appender
#log4j.appender.rolling.MaxBackupIndex=5

# Configure the rolling appender to use the PatternLayout
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout

# Configure the conversion pattern for the rolling appender
log4j.appender.rolling.layout.ConversionPattern=%d - %p %c - %m%n




then, in every classes that needs logging I do this:

public class SomeAction
extends MyBaseAction

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


public ActionForward execute (..etc, etc...)
  throws Exception{

 ...
 ...
log.debug(Delete Item: + item.getId() +
 from Catalog: + cat.getId());
 ...
 ...
}



Hope that helps you (or anyone following this thread)




 Pedro Salgado

 On 05/12/2003 06:56, Rahul Mohan [EMAIL PROTECTED] wrote:

  hi nick,
 
  thanks for responding...its the logger class thats missing ithink...
  this is the exception i get when i try to view the page:
 
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at app.LogonAction.perform(Unknown Source)

 
  what could be the problem? please excuse my novice level...
 
  thanks again..
 
 
  - Original Message -
  From: Nick Faiz [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Sent: Friday, December 05, 2003 12:22 PM
  Subject: RE: Log4j with Struts
 
 
  Well, what class can't it find, the Logger or the LogonAction.class ?
 
  I use it with Struts, without a hassle, on WebLogic 7.2.
 
  Nick
 
  -Original Message-
  From: Rahul Mohan [mailto:[EMAIL PROTECTED]
  Sent: Friday, 5 December 2003 5:46 PM
  To: struts
  Subject: Log4j with Struts
 
  Hi,
 
  has anybody tried using Log4j with struts? I tried the following code
  and its giving a ClassDefNotFoundException during runtime..
 
  this is inside the perform method:
   String str = new String(LogonAction.class.getName()); //LogonAction
  is
  an Action Class
   logger = Logger.getLogger(str); //this line is throwing the
  exception -
  apparently str is not having a classdef
 
  somebody please help me with this.or is there any other method to
  perform logging?
 
  i am using tomcat4.1 ...
 
  Thanks in advance.
 
  Rahul Mohan
  ~~~
  MasterCraft Group
  Tata Consultancy Services
  Tata Research Development and Design Center
  54B

Re: Log4j with Struts

2003-12-05 Thread Joe Germuska
On Dec 5, 2003, at 9:03 AM, James Mitchell wrote:

Not sure if this was mentioned, but you should configure your app to 
use
commons-logging and then specify in its configuration to use Log4j.  
That
way you can swap out logging implementations by simple configuration 
and
library addtions/removal (no recompile necessary).

At the risk of quibbling, I would dispute this as a general rule; 
commons-logging is great for library packages which may be used in a 
variety of contexts, but unless you're writing a Struts application for 
general distribution and re-use, there's less justification for using 
commons-logging universally.

There's nothing wrong with using commons-logging in applications and 
other more finished products, but commons-logging is a greatly 
simplified API (for good reason) and in an application, you may find it 
worthwhile to commit to a more sophisticated logging tool (like Log4J) 
in order to have more powerful logging features.

Joe
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
 We want beef in dessert if we can get it there.
  -- Betty Hogan, Director of New Product Development, National 
Cattlemen's Beef Association




smime.p7s
Description: S/MIME cryptographic signature


[OT] Log4J raw vs. commons-logging/Log4J (was Re: Log4j with Struts)

2003-12-05 Thread Kirk Wylie
Joe Germuska wrote:
At the risk of quibbling, I would dispute this as a general rule; 
commons-logging is great for library packages which may be used in a 
variety of contexts, but unless you're writing a Struts application for 
general distribution and re-use, there's less justification for using 
commons-logging universally.

There's nothing wrong with using commons-logging in applications and 
other more finished products, but commons-logging is a greatly 
simplified API (for good reason) and in an application, you may find it 
worthwhile to commit to a more sophisticated logging tool (like Log4J) 
in order to have more powerful logging features.
Are you talking about the code-level interface (i.e. Log versus Logger) 
or in terms of the configuration? Because in our applications, we've 
taken the commons-logging approach, though we initialize the 
commons-logging package with a complex Log4J configuration, so that we 
have in essence the best of both worlds: we can use the 
behind-the-scenes power of Log4j, with the ability to swap out logging 
implementations that commons-logging gives us.

I've not seen much in the log-level API that's substantially different. 
What sorts of power are you talking about?

Kirk Wylie
M7 Corporation
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Log4J raw vs. commons-logging/Log4J (was Re: Log4j with Struts)

2003-12-05 Thread Joe Germuska
Are you talking about the code-level interface (i.e. Log versus 
Logger) or in terms of the configuration? Because in our applications, 
we've taken the commons-logging approach, though we initialize the 
commons-logging package with a complex Log4J configuration, so that we 
have in essence the best of both worlds: we can use the 
behind-the-scenes power of Log4j, with the ability to swap out logging 
implementations that commons-logging gives us.

I've not seen much in the log-level API that's substantially 
different. What sorts of power are you talking about?

Specifically, in a recent application we chose to use Log4J directly 
rather than Commons Logging because we wanted to use Log4J's
nested diagnostic context, in which you can basically store 
thread-local values (like current user) and have them available for all 
logging messages.

http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/NDC.html
http://jakarta.apache.org/log4j/docs/FAQ.html#NDC
Certainly if the commons logging API is adequate, you're probably 
better off using it by default, just like you're better off writing 
your code to use JAXP instead of a specific XML parser, if you can get 
away with it.

The point being that the choice to commit to one api over an 
abstraction layer is much less important when you're writing a 
self-contained application than when you're writing libraries.



Joe

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
 We want beef in dessert if we can get it there.
  -- Betty Hogan, Director of New Product Development, National 
Cattlemen's Beef Association




smime.p7s
Description: S/MIME cryptographic signature


RE: Log4j with Struts

2003-12-05 Thread Daniel Lipofsky
 
  String str = new String(LogonAction.class.getName()); 
 

This is completely off-topic, but using
new String(String)
is almost always wasteful.  Strings are
immutable, so there is no need to copy them.
- Dan

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



Log4j with Struts

2003-12-04 Thread Rahul Mohan
Hi,

has anybody tried using Log4j with struts? I tried the following code and its 
giving a ClassDefNotFoundException during runtime..

this is inside the perform method:
 String str = new String(LogonAction.class.getName()); //LogonAction is an Action 
Class
 logger = Logger.getLogger(str); //this line is throwing the exception - 
apparently str is not having a classdef

somebody please help me with this.or is there any other method to perform logging? 

i am using tomcat4.1 ...

Thanks in advance.

Rahul Mohan
~~~
MasterCraft Group
Tata Consultancy Services
Tata Research Development and Design Center
54B, Hadapsar Industrial Estate
Pune - 411 013
Phone: +91 4042333 or 4031122 Extn 2556
+91 20 31544082 ( Mobile )
Fax: +91 20 4042399
email : [EMAIL PROTECTED]
~~~

RE: Log4j with Struts

2003-12-04 Thread Nick Faiz
Well, what class can't it find, the Logger or the LogonAction.class ?

I use it with Struts, without a hassle, on WebLogic 7.2.

Nick

-Original Message-
From: Rahul Mohan [mailto:[EMAIL PROTECTED] 
Sent: Friday, 5 December 2003 5:46 PM
To: struts
Subject: Log4j with Struts

Hi,

has anybody tried using Log4j with struts? I tried the following code
and its giving a ClassDefNotFoundException during runtime..

this is inside the perform method:
 String str = new String(LogonAction.class.getName()); //LogonAction is
an Action Class
 logger = Logger.getLogger(str); //this line is throwing the exception -
apparently str is not having a classdef

somebody please help me with this.or is there any other method to
perform logging? 

i am using tomcat4.1 ...

Thanks in advance.

Rahul Mohan
~~~
MasterCraft Group
Tata Consultancy Services
Tata Research Development and Design Center
54B, Hadapsar Industrial Estate
Pune - 411 013
Phone: +91 4042333 or 4031122 Extn 2556
+91 20 31544082 ( Mobile )
Fax: +91 20 4042399
email : [EMAIL PROTECTED]
~~~

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



STRUTS LOG4J

2003-11-21 Thread Todor Sergueev Petkov
Hi everybody... I know that one of the ways to use log4j with struts is 
to load a log4j.properties file at servlet container startup...
But what if I have a business layer that has no direct connection to a 
servlet container or I want to run some stand-alone tests and 
logging... Do I have to have two separate ways of loading the 
log4j.properties file or is there a way to do it so it works in servlet 
container and stand-alone environment?!

Thanks a lot,
Todor
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: STRUTS LOG4J

2003-11-21 Thread shirishchandra.sakhare
easy pizzy...We are already having the same scenario.
Don't use the default log4j initialization(which means just putting the 
log4j.properties file in the class path and forget about it.)This way you have no 
control over the initialization.
You write a class(e.g. LogEnvLoader) and in that class load the property file(Or XMl 
file if you want) and initialize the log4j environment.
And then you can call this initialization class form either the init method of servlet 
or from any model layer class.

HTH.
regards,
Shirish.

-Original Message-
From: Todor Sergueev Petkov [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 3:29 PM
To: Struts Users Mailing List
Subject: STRUTS LOG4J


Hi everybody... I know that one of the ways to use log4j with struts is 
to load a log4j.properties file at servlet container startup...
But what if I have a business layer that has no direct connection to a 
servlet container or I want to run some stand-alone tests and 
logging... Do I have to have two separate ways of loading the 
log4j.properties file or is there a way to do it so it works in servlet 
container and stand-alone environment?!

Thanks a lot,
Todor


-
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: STRUTS LOG4J

2003-11-21 Thread Christian Bollmeyer
Am Freitag, 21. November 2003 15:34 schrieb 
[EMAIL PROTECTED]:

 easy pizzy...We are already having the same scenario.
 Don't use the default log4j initialization(which means just putting
 the log4j.properties file in the class path and forget about it.)This
 way you have no control over the initialization. You write a
 class(e.g. LogEnvLoader) and in that class load the property file(Or
 XMl file if you want) and initialize the log4j environment. And then
 you can call this initialization class form either the init method of
 servlet or from any model layer class.

Just one addition: I would recommend not to use log4j directly,
but via the commons.logging wrapper (it's really easy and IMHO
less intrusive, plus you're not limited to the log4j framework that
way). Then, considering the classpath issue, it makes no difference 
whether you're dealing with a web or conventional application.
The only thing you have to make sure is that the configuration
files are being found, i.e. reside inside the classpath. Neither
the classpath concept nor Log4j are web-specific in any way.

 HTH.
 regards,
 Shirish.

-- Chris.


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



log4j configuration question

2003-09-25 Thread David Erickson
A couple quick questions:

1) Using tomcat is it possible to configure log4j to only be functional for
your particular webapp?  Because I put the log4j jar into my web-inf/lib
directory, built a log4j.properties and put it in /web-inf/classes and set
log4j's rootlogger to debug and got log messages from tns of stuff that
I certainly hadn't setup to log.. just wondering.

2) I'd like to keep my log files potentially in my /web-inf/logs directory,
however how can I get a handle on the realpath to that directory from the
config file if I don't know where the deployed path would be?!  I'm assuming
I'd have to do that programmatically after the config file loads and that
could be a major PITA if there are lots of log files correct?  Some help and
guidance in this direction would be appreciated.

-David


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



log4j setup

2003-09-24 Thread Viral_Thakkar
Please let me know what are the steps one need to do to configure the
log4j.



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



RE: log4j setup

2003-09-24 Thread Davide Bruzzone
Here are the steps:

- Make sure that the appropriate Log4J JAR file is in your /WEB-INF/lib
directory
- Put your log4j.properties file in /WEB-INF/classes
- Wherever you want to log, add the following code:

import org.apache.log4j.Logger;

...

// This is a private static attribute within the class
private static Logger logger = Logger.getLogger(The name of the
class.class.getName());

...

// When you want to log something...
logger.debug(Something...);

Hope this helps... If you need more information about the
log4j.properties file, etc., the Log4J site points to lots of great (and
very detailed) documentation that you can use as a starting point...

Cheers...

Dave Bruzzone

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 24, 2003 7:23 AM
To: Struts Users Mailing List
Subject: log4j setup


Please let me know what are the steps one need to do to configure the
log4j.



-
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 setup

2003-09-24 Thread David Thielen
I put log4j.jar in the application server lib file - so all web apps are
using the same logger. It has worked fine for me in that configuration.


- Original Message - 
From: Davide Bruzzone [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 7:40 AM
Subject: RE: log4j setup


Here are the steps:

- Make sure that the appropriate Log4J JAR file is in your /WEB-INF/lib
directory
- Put your log4j.properties file in /WEB-INF/classes
- Wherever you want to log, add the following code:

import org.apache.log4j.Logger;

...

// This is a private static attribute within the class
private static Logger logger = Logger.getLogger(The name of the
class.class.getName());

...

// When you want to log something...
logger.debug(Something...);

Hope this helps... If you need more information about the
log4j.properties file, etc., the Log4J site points to lots of great (and
very detailed) documentation that you can use as a starting point...

Cheers...

Dave Bruzzone

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 7:23 AM
To: Struts Users Mailing List
Subject: log4j setup


Please let me know what are the steps one need to do to configure the
log4j.



-
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]




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



RE: log4j setup

2003-09-24 Thread Mathew, Manoj
Hi

there are three ways( known to me) to load the log4j at the server startup
 1.Create ur own servlet put the code in Init()and load it at the begining of your 
application
 2.Extend Action Servlet
 3.  through the following way.

I find the 3rd one better because it sound like struts way of doing it...!!
  this is what we have done..

in struts config
!-- == Plug Ins Configuration == --
plug-in className=com.ff.gg.e.l.gi.ApplicationStartup /

/struts-config

ApplicationStartup.java

public class ApplicationStartup implements PlugIn {

public void init(ActionServlet servlet, ModuleConfig config) throws 
ServletException {
try {
ProposalLogger.configureLog4J();
Category cat = Category.getInstance(ApplicationStartup.class);
cat.info(log4j has been properly configured on application 
startup.);
} catch()


this will load and configure your log$j each time you start your server..

then i have a class which handle the logging..

public final class MylLogger {
public static String LOG4J_PROPERTIES_FILENAME_TEST = 
proposalLog4j.mytest.properties;
public static void configureLog4J() {

String filename = LOG4J_PROPERTIES_FILENAME_TEST;
try {
java.io.InputStream is = 
ProposalLogger.class.getResourceAsStream(filename);
java.util.Properties prop = new java.util.Properties();
prop.load(is);
PropertyConfigurator.configure(prop);
is.close();
} catch {}
Category cat = Category.getInstance(ProposalLogger.class.getName());
cat.info( Log4J logging has been properly configured using file  + 
filename + .);
return;
}
...
then I use these two these two methods do my logging..
public static void logError(Category category, String msg, CustomerLoggingInfo 
customerInfo) {}
public static void logTiming(Class caller, long start, long end, String msg) {}

If anybody has any better idea please let us know.
thanks
manoj

-Original Message-
From: Davide Bruzzone [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 8:41 AM
To: Struts Users Mailing List
Subject: RE: log4j setup


Here are the steps:

- Make sure that the appropriate Log4J JAR file is in your /WEB-INF/lib
directory
- Put your log4j.properties file in /WEB-INF/classes
- Wherever you want to log, add the following code:

import org.apache.log4j.Logger;

...

// This is a private static attribute within the class
private static Logger logger = Logger.getLogger(The name of the
class.class.getName());

...

// When you want to log something...
logger.debug(Something...);

Hope this helps... If you need more information about the
log4j.properties file, etc., the Log4J site points to lots of great (and
very detailed) documentation that you can use as a starting point...

Cheers...

Dave Bruzzone

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 24, 2003 7:23 AM
To: Struts Users Mailing List
Subject: log4j setup


Please let me know what are the steps one need to do to configure the
log4j.



-
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]


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



Re: log4j setup

2003-09-24 Thread jbisotti

Step 1.  RTFM




Viral_Thakkar [EMAIL PROTECTED] on 09/24/2003 09:23:22 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:log4j setup


Please let me know what are the steps one need to do to configure the
log4j.



-
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 setup

2003-09-24 Thread James Mitchell
Step 2. http://www.catb.org/~esr/faqs/smart-questions.html#before


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
770.822.3359
AIM:jmitchtx



- Original Message - 
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 12:03 PM
Subject: Re: log4j setup


 
 Step 1.  RTFM
 
 
 
 
 Viral_Thakkar [EMAIL PROTECTED] on 09/24/2003 09:23:22 AM
 
 Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
 
 To:Struts Users Mailing List [EMAIL PROTECTED]
 cc:
 Subject:log4j setup
 
 
 Please let me know what are the steps one need to do to configure the
 log4j.
 
 
 
 -
 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]

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



RE: log4j setup

2003-09-24 Thread Chen, Gin
Okay.. Done.. Now what's step 2?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 24, 2003 12:03 PM
To: Struts Users Mailing List
Subject: Re: log4j setup



Step 1.  RTFM




Viral_Thakkar [EMAIL PROTECTED] on 09/24/2003 09:23:22 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:log4j setup


Please let me know what are the steps one need to do to configure the
log4j.



-
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]

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



RE: log4j setup

2003-09-24 Thread Chen, Gin
Doh.. Leave it to James to ruin a joke.


-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 24, 2003 1:19 PM
To: Struts Users Mailing List
Subject: Re: log4j setup


Step 2. http://www.catb.org/~esr/faqs/smart-questions.html#before


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
770.822.3359
AIM:jmitchtx



- Original Message - 
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 12:03 PM
Subject: Re: log4j setup


 
 Step 1.  RTFM
 
 
 
 
 Viral_Thakkar [EMAIL PROTECTED] on 09/24/2003 09:23:22 AM
 
 Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
 
 To:Struts Users Mailing List [EMAIL PROTECTED]
 cc:
 Subject:log4j setup
 
 
 Please let me know what are the steps one need to do to configure the
 log4j.
 
 
 
 -
 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]

-
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 Struts

2003-09-23 Thread Mahesh Joshi
Hi,

Unfortunately this does not work for Tomcat 4.1.24

When I put log4j-1.2.8 in the jak*/common/lib or jak*/shared/lib I dont get
the results desired.
In the former, tomcat doesnt startup and in the latter struts does not
initialize.

Looks like I am missing something in the relationship between
commons-logging and Log4J.

Thanks!

Mahesh

- Original Message - 
From: Abhijeet Mahalkar [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, September 22, 2003 2:39 AM
Subject: Re: Log4J and Struts


hi Mahesh,

No u have to keep ur log4j-1.2.8.jar into websphere\appserver\lib dir not
web-inf.
here it will not give any error.
I was working on the same kind of error an hr before but copy paste into
websphere\appserver\lib solved my problem...

regards
abhijeet

- Original Message - 
From: Mahesh Joshi [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, September 22, 2003 2:59 PM
Subject: Log4J and Struts


Hi,

I am moving my current web application to struts and I am facing a problem.

We use Log4J for our logging (Log4J version 1.2.8)

If I have the log4j-1.2.8.jar in my WEB-INF/lib directory, the Action
servlet does not initialize

Tomcat log file says:
javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
2)
...
- Root Cause -
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:432)
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:525)
 ... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
 at java.lang.Class.getConstructor0(Class.java:1762)
 at java.lang.Class.getConstructor(Class.java:1002)
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:429)
 ... 29 more


If I remove the log4J.jar from WEB-INF/lib, the ActionServlet
initializes(but then my app. cant log).
I searched the archive and implemented the solution provided by Sgarlata
Matt
http://www.mail-archive.com/[EMAIL PROTECTED]/msg79448.html

Howeve, putting the commons-logging.properties in the WEB-INF/classes/
folder didnt help either.
(note that our log4J config file has been kept in the WEB-INF folder. Even
if I keep the commons-logging.properties in the WEB-INF folder, it doesnt
work).

Please help!

Mahesh


-
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]


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



Log4J and Struts

2003-09-22 Thread Mahesh Joshi
Hi,

I am moving my current web application to struts and I am facing a problem.

We use Log4J for our logging (Log4J version 1.2.8)

If I have the log4j-1.2.8.jar in my WEB-INF/lib directory, the Action
servlet does not initialize

Tomcat log file says:
javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
2)
...
- Root Cause -
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:432)
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:525)
 ... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
 at java.lang.Class.getConstructor0(Class.java:1762)
 at java.lang.Class.getConstructor(Class.java:1002)
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:429)
 ... 29 more


If I remove the log4J.jar from WEB-INF/lib, the ActionServlet
initializes(but then my app. cant log).
I searched the archive and implemented the solution provided by Sgarlata
Matt
http://www.mail-archive.com/[EMAIL PROTECTED]/msg79448.html

Howeve, putting the commons-logging.properties in the WEB-INF/classes/
folder didnt help either.
(note that our log4J config file has been kept in the WEB-INF folder. Even
if I keep the commons-logging.properties in the WEB-INF folder, it doesnt
work).

Please help!

Mahesh


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



Re: Log4J and Struts

2003-09-22 Thread Abhijeet Mahalkar
hi Mahesh,

No u have to keep ur log4j-1.2.8.jar into websphere\appserver\lib dir not web-inf. 
here it will not give any error.
I was working on the same kind of error an hr before but copy paste into 
websphere\appserver\lib solved my problem...

regards
abhijeet

- Original Message - 
From: Mahesh Joshi [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, September 22, 2003 2:59 PM
Subject: Log4J and Struts


Hi,

I am moving my current web application to struts and I am facing a problem.

We use Log4J for our logging (Log4J version 1.2.8)

If I have the log4j-1.2.8.jar in my WEB-INF/lib directory, the Action
servlet does not initialize

Tomcat log file says:
javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
2)
...
- Root Cause -
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:432)
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:525)
 ... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
 at java.lang.Class.getConstructor0(Class.java:1762)
 at java.lang.Class.getConstructor(Class.java:1002)
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:429)
 ... 29 more


If I remove the log4J.jar from WEB-INF/lib, the ActionServlet
initializes(but then my app. cant log).
I searched the archive and implemented the solution provided by Sgarlata
Matt
http://www.mail-archive.com/[EMAIL PROTECTED]/msg79448.html

Howeve, putting the commons-logging.properties in the WEB-INF/classes/
folder didnt help either.
(note that our log4J config file has been kept in the WEB-INF folder. Even
if I keep the commons-logging.properties in the WEB-INF folder, it doesnt
work).

Please help!

Mahesh


-
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: Generating logs w/Log4J in ActionClass

2003-08-24 Thread Kapadia Mitesh-C23457
Thanks Navjot -

Quick question -- are you sure the .properties file must be in your classpath?

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 10:10 AM
To: Struts Users Mailing List
Subject: RE: Generating logs w/Log4J in ActionClass


i just vaguely remember
private Logger logger = Logger.getLogger(Test.class); logger.debug(Better Check log4j 
docs);

and keep the log4j.properties file in classpath.

hth
navjot singh


|-Original Message-
|From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
|Sent: Thursday, August 21, 2003 9:25 PM
|To: [EMAIL PROTECTED]
|Subject: Generating logs w/Log4J in ActionClass
|
|
|I have the appropriate configurations completed to use Log4J w/Tomcat.
|However, how would I invoke Log4J from within my action class to generate
|DEBUG statements? 
|I have the following package imported: 
|import org.apache.log4j.*; 
|Any examples would be most appreciated. 
|Thanks in advance. 
|- Mitesh 
|

-
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]



Generating logs w/Log4J in ActionClass

2003-08-22 Thread Kapadia Mitesh-C23457
I have the appropriate configurations completed to use Log4J w/Tomcat. 
However, how would I invoke Log4J from within my action class to generate
DEBUG statements? 
I have the following package imported: 
import org.apache.log4j.*; 
Any examples would be most appreciated. 
Thanks in advance. 
- Mitesh 


RE: Generating logs w/Log4J in ActionClass

2003-08-22 Thread Mike Jasnowski
In your action class, retrieve your log instance

Log LOG = LogFactory.getLog(YourAction.class);

Then wherever you need to log:

if (LOG.isDebugEnabled()) {
  LOG.debug(Log your debug msg here);
}

 Replace isDebugEnabled() with whatever level you want to use.

HTH,
Mike J

-Original Message-
From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 11:55 AM
To: [EMAIL PROTECTED]
Subject: Generating logs w/Log4J in ActionClass


I have the appropriate configurations completed to use Log4J w/Tomcat. 
However, how would I invoke Log4J from within my action class to generate
DEBUG statements? 
I have the following package imported: 
import org.apache.log4j.*; 
Any examples would be most appreciated. 
Thanks in advance. 
- Mitesh 


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



RE: Generating logs w/Log4J in ActionClass

2003-08-22 Thread Mike Jasnowski
Sorry, this is with commons logging not log4j specifically

-Original Message-
From: Mike Jasnowski [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 9:29 AM
To: Struts Users Mailing List
Subject: RE: Generating logs w/Log4J in ActionClass


In your action class, retrieve your log instance

Log LOG = LogFactory.getLog(YourAction.class);

Then wherever you need to log:

if (LOG.isDebugEnabled()) {
  LOG.debug(Log your debug msg here);
}

 Replace isDebugEnabled() with whatever level you want to use.

HTH,
Mike J

-Original Message-
From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 11:55 AM
To: [EMAIL PROTECTED]
Subject: Generating logs w/Log4J in ActionClass


I have the appropriate configurations completed to use Log4J w/Tomcat. 
However, how would I invoke Log4J from within my action class to generate
DEBUG statements? 
I have the following package imported: 
import org.apache.log4j.*; 
Any examples would be most appreciated. 
Thanks in advance. 
- Mitesh 


-
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: Generating logs w/Log4J in ActionClass

2003-08-22 Thread David Stemm
I just create a class that wraps the log statements and would have a
function like this:

public static void debug(String message, String aCategory)
   {
  Category cat = Category.getInstance(aCategory);
  cat.debug(message);
   }

then when I need to use this I would call something like:

MyLogger.debug(Message, this.getClass().getName());

Hope that helps.

- Original Message - 
From: Mike Jasnowski [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 8:33 AM
Subject: RE: Generating logs w/Log4J in ActionClass


 Sorry, this is with commons logging not log4j specifically

 -Original Message-
 From: Mike Jasnowski [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 22, 2003 9:29 AM
 To: Struts Users Mailing List
 Subject: RE: Generating logs w/Log4J in ActionClass


 In your action class, retrieve your log instance

 Log LOG = LogFactory.getLog(YourAction.class);

 Then wherever you need to log:

 if (LOG.isDebugEnabled()) {
   LOG.debug(Log your debug msg here);
 }

  Replace isDebugEnabled() with whatever level you want to use.

 HTH,
 Mike J

 -Original Message-
 From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 21, 2003 11:55 AM
 To: [EMAIL PROTECTED]
 Subject: Generating logs w/Log4J in ActionClass


 I have the appropriate configurations completed to use Log4J w/Tomcat.
 However, how would I invoke Log4J from within my action class to generate
 DEBUG statements?
 I have the following package imported:
 import org.apache.log4j.*;
 Any examples would be most appreciated.
 Thanks in advance.
 - Mitesh


 -
 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]



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



RE: Generating logs w/Log4J in ActionClass

2003-08-22 Thread Navjot Singh
i just vaguely remember
private Logger logger = Logger.getLogger(Test.class);
logger.debug(Better Check log4j docs);

and keep the log4j.properties file in classpath.

hth
navjot singh


|-Original Message-
|From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
|Sent: Thursday, August 21, 2003 9:25 PM
|To: [EMAIL PROTECTED]
|Subject: Generating logs w/Log4J in ActionClass
|
|
|I have the appropriate configurations completed to use Log4J w/Tomcat. 
|However, how would I invoke Log4J from within my action class to generate
|DEBUG statements? 
|I have the following package imported: 
|import org.apache.log4j.*; 
|Any examples would be most appreciated. 
|Thanks in advance. 
|- Mitesh 
|

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



RE: Generating logs w/Log4J in ActionClass

2003-08-22 Thread Kapadia Mitesh-C23457
Thanks David.

Quick question -- do I just have the listed method you provided in my wrapper class?


-Original Message-
From: David Stemm [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 8:56 AM
To: Struts Users Mailing List
Subject: Re: Generating logs w/Log4J in ActionClass


I just create a class that wraps the log statements and would have a function like 
this:

public static void debug(String message, String aCategory)
   {
  Category cat = Category.getInstance(aCategory);
  cat.debug(message);
   }

then when I need to use this I would call something like:

MyLogger.debug(Message, this.getClass().getName());

Hope that helps.

- Original Message - 
From: Mike Jasnowski [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 8:33 AM
Subject: RE: Generating logs w/Log4J in ActionClass


 Sorry, this is with commons logging not log4j specifically

 -Original Message-
 From: Mike Jasnowski [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 22, 2003 9:29 AM
 To: Struts Users Mailing List
 Subject: RE: Generating logs w/Log4J in ActionClass


 In your action class, retrieve your log instance

 Log LOG = LogFactory.getLog(YourAction.class);

 Then wherever you need to log:

 if (LOG.isDebugEnabled()) {
   LOG.debug(Log your debug msg here);
 }

  Replace isDebugEnabled() with whatever level you want to use.

 HTH,
 Mike J

 -Original Message-
 From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 21, 2003 11:55 AM
 To: [EMAIL PROTECTED]
 Subject: Generating logs w/Log4J in ActionClass


 I have the appropriate configurations completed to use Log4J w/Tomcat. 
 However, how would I invoke Log4J from within my action class to 
 generate DEBUG statements? I have the following package imported:
 import org.apache.log4j.*;
 Any examples would be most appreciated.
 Thanks in advance.
 - Mitesh


 -
 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]



-
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: Generating logs w/Log4J in ActionClass

2003-08-22 Thread David Stemm
I have methods for debug, info, warn and error.  Attached is a sample class
I use.

- Original Message - 
From: Kapadia Mitesh-C23457 [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 11:08 AM
Subject: RE: Generating logs w/Log4J in ActionClass


 Thanks David.

 Quick question -- do I just have the listed method you provided in my
wrapper class?


 -Original Message-
 From: David Stemm [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 22, 2003 8:56 AM
 To: Struts Users Mailing List
 Subject: Re: Generating logs w/Log4J in ActionClass


 I just create a class that wraps the log statements and would have a
function like this:

 public static void debug(String message, String aCategory)
{
   Category cat = Category.getInstance(aCategory);
   cat.debug(message);
}

 then when I need to use this I would call something like:

 MyLogger.debug(Message, this.getClass().getName());

 Hope that helps.

 - Original Message - 
 From: Mike Jasnowski [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, August 22, 2003 8:33 AM
 Subject: RE: Generating logs w/Log4J in ActionClass


  Sorry, this is with commons logging not log4j specifically
 
  -Original Message-
  From: Mike Jasnowski [mailto:[EMAIL PROTECTED]
  Sent: Friday, August 22, 2003 9:29 AM
  To: Struts Users Mailing List
  Subject: RE: Generating logs w/Log4J in ActionClass
 
 
  In your action class, retrieve your log instance
 
  Log LOG = LogFactory.getLog(YourAction.class);
 
  Then wherever you need to log:
 
  if (LOG.isDebugEnabled()) {
LOG.debug(Log your debug msg here);
  }
 
   Replace isDebugEnabled() with whatever level you want to use.
 
  HTH,
  Mike J
 
  -Original Message-
  From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
  Sent: Thursday, August 21, 2003 11:55 AM
  To: [EMAIL PROTECTED]
  Subject: Generating logs w/Log4J in ActionClass
 
 
  I have the appropriate configurations completed to use Log4J w/Tomcat.
  However, how would I invoke Log4J from within my action class to
  generate DEBUG statements? I have the following package imported:
  import org.apache.log4j.*;
  Any examples would be most appreciated.
  Thanks in advance.
  - Mitesh
 
 
  -
  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]
 
 

 -
 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]



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

Re: Generating logs w/Log4J in ActionClass

2003-08-22 Thread Pedro Emanuel de Castro Faria Salgado

 I have the appropriate configurations completed to use Log4J w/Tomcat.
 However, how would I invoke Log4J from within my action class to
 generate DEBUG statements?
 I have the following package imported:
 import org.apache.log4j.*;
 Any examples would be most appreciated.
 Thanks in advance.
 - Mitesh

 add an attribute
 private Logger log = Logger.getLogger();

 to debug use
 if (log.isDebugEnabled()) {
log.debug(message);
 }

I think that will do the trick.

Pedro Salgado



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



Re: log4j configuration and usage

2003-08-19 Thread Vikram Goyal
Hi Viral,

This is not the log4 list. Try the log4j list or read the several articles
on how to use it.

http://jakarta.apache.org/log4j/docs/documentation.html

PS: Which PU are you in at Infy?

Regards,
Vikram

- Original Message - 
From: Viral_Thakkar [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 3:21 PM
Subject: log4j configuration and usage


I have log4j 1.2.8 version.

Can anyone please tell me the log4j configuration required to do, for
its use for logging and how to use log4j?

Example would be better.

-
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]



log4j configuration and usage

2003-08-18 Thread Viral_Thakkar
I have log4j 1.2.8 version.

Can anyone please tell me the log4j configuration required to do, for
its use for logging and how to use log4j? 

Example would be better.

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



RE: RE : RE : Log4j Warnings

2003-08-14 Thread Mohd Amin Mohd Din
It's not working. Any sample or doc that could be read?

-Original Message-
From: Laurent MARQUEZ [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 2:45 PM
To: 'Struts Users Mailing List'
Subject: RE : RE : Log4j Warnings



THIS:
###
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender (a carrier return here)
log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender (a carrier return here)
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
###
Laurent.


-Message d'origine-



De : Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 14 août 2003 08:19
À : [EMAIL PROTECTED]
Objet : Log4j Warnings


Hi,
 
I'm getting log4j warnings aftering moving to struts 1.1
 
log4j:WARN No appenders could be found for logger
(org.apache.struts.util.Proper tyMessageResources). log4j:WARN Please
initialize the log4j system properly.
 
commons-logging.properties file has this
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er
 
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
 
any help is greatly appreciated
 
Amin


-
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]





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



RE: RE : RE : Log4j Warnings

2003-08-14 Thread Lee, Yau-Pang
In my commons-logging.properties file, I use the default logger factory from
commons-loggings, as in:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFac
toryImpl

and it works for me.

YPL

-Original Message-
From: Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 4:53 AM
To: 'Struts Users Mailing List'
Subject: RE: RE : RE : Log4j Warnings


It's not working. Any sample or doc that could be read?

-Original Message-
From: Laurent MARQUEZ [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 2:45 PM
To: 'Struts Users Mailing List'
Subject: RE : RE : Log4j Warnings



THIS:
###
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender (a carrier return here)
log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender (a carrier return here)
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
###
Laurent.


-Message d'origine-



De : Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 14 août 2003 08:19
À : [EMAIL PROTECTED]
Objet : Log4j Warnings


Hi,
 
I'm getting log4j warnings aftering moving to struts 1.1
 
log4j:WARN No appenders could be found for logger
(org.apache.struts.util.Proper tyMessageResources). log4j:WARN Please
initialize the log4j system properly.
 
commons-logging.properties file has this
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er
 
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
 
any help is greatly appreciated
 
Amin


-
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]





-
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 : RE : Log4j Warnings

2003-08-14 Thread Laurent MARQUEZ


THIS:
###
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender (a carrier return here)
log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender (a carrier return here)
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
###
Laurent.


-Message d'origine-



De : Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 14 août 2003 08:19
À : [EMAIL PROTECTED]
Objet : Log4j Warnings


Hi,
 
I'm getting log4j warnings aftering moving to struts 1.1
 
log4j:WARN No appenders could be found for logger
(org.apache.struts.util.Proper tyMessageResources). log4j:WARN Please
initialize the log4j system properly.
 
commons-logging.properties file has this
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er
 
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
 
any help is greatly appreciated
 
Amin


-
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]



Log4j Warnings

2003-08-14 Thread Mohd Amin Mohd Din
Hi,
 
I'm getting log4j warnings aftering moving to struts 1.1
 
log4j:WARN No appenders could be found for logger
(org.apache.struts.util.Proper
tyMessageResources).
log4j:WARN Please initialize the log4j system properly.
 
commons-logging.properties file has this
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er
 
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
 
any help is greatly appreciated
 
Amin


RE : Log4j Warnings

2003-08-14 Thread Laurent MARQUEZ
Try this:
###
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender 
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
###
Laurent.


-Message d'origine-



De : Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 14 août 2003 08:19
À : [EMAIL PROTECTED]
Objet : Log4j Warnings


Hi,
 
I'm getting log4j warnings aftering moving to struts 1.1
 
log4j:WARN No appenders could be found for logger
(org.apache.struts.util.Proper tyMessageResources). log4j:WARN Please
initialize the log4j system properly.
 
commons-logging.properties file has this
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogg
er
 
log4j.properties has this
log4j.rootLogger=DEBUG, stdout, file
 
# stdout appender log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=[%c] %p: %m%n
 
# file appender log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=PostGraduate.log
log4j.appender.file.MaxFileSize=1MB 
log4j.appender.file.MaxBackupIndex=2 
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n
 
any help is greatly appreciated
 
Amin


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



common-logging, Struts, Log4j

2003-06-26 Thread rablists
Hi. I have problem in using the common-logging with struts and 
Log4j. I am basically lost. I  have short questions, I appreciate if 
anyone can help me little bit. these are the questions with examples:

The file outputfile.log that I specify in 
log4j.appender.LOGFILE.File=outputfile.log where it is located? 
where I find it? is it physical file?

I dont know why my configuration is not working, although I put the 
following files in the classpath WEB-INF/classes/org/myclasses/:

commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL
ogger

log4j.properties:
log4j.rootLogger=DEBUG, rolling
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%
n
log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=outputfile.log
log4j.appender.rolling.MaxFileSize=100KB
log4j.appender.rolling.MaxBackupIndex=1
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p %
c - %m%n

What else should I specify, or configure to make it to work? I have 
log4j-1.2.4.jar in my WEB-INF/lib/

Should I set any system propreties? or web.xml? or struts-config? 

In my classes I am doing that:
  protected static final org.apache.commons.logging.Log log = 
org.apache.commons.logging.LogFactory.getLog(this.class);

if (log.isDebugEnabled()) 
  log.debug(getMessage( + locale + , + key + ));

(How can I enable/disable the Debug or Trace?)


Thank you in advance. I am really stuck and I couldnt make it to 
work. I am using tomcat 4.18


Rabih



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



RE: common-logging, Struts, Log4j

2003-06-26 Thread Michael Remijan

I had the same problem and was only able to solve it by forceably loading the log4j 
configuration file.  I put the following in the servlet's init() method:

// get log4j property file.
java.net.URL log4jProps = 
ActionServlet.class.getClassLoader().getResource(log4j.properties);
System.out.println(System.out.println - Log4j URL:  + log4jProps);

// configure log4j
PropertyConfigurator.configure(log4jProps);

Mike

-Original Message-
From: rablists [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 7:51 AM
To: [EMAIL PROTECTED]
Subject: common-logging, Struts, Log4j


Hi. I have problem in using the common-logging with struts and 
Log4j. I am basically lost. I  have short questions, I appreciate if 
anyone can help me little bit. these are the questions with examples:

The file outputfile.log that I specify in 
log4j.appender.LOGFILE.File=outputfile.log where it is located? 
where I find it? is it physical file?

I dont know why my configuration is not working, although I put the 
following files in the classpath WEB-INF/classes/org/myclasses/:

commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL
ogger

log4j.properties:
log4j.rootLogger=DEBUG, rolling
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%
n
log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=outputfile.log
log4j.appender.rolling.MaxFileSize=100KB
log4j.appender.rolling.MaxBackupIndex=1
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p %
c - %m%n

What else should I specify, or configure to make it to work? I have 
log4j-1.2.4.jar in my WEB-INF/lib/

Should I set any system propreties? or web.xml? or struts-config? 

In my classes I am doing that:
  protected static final org.apache.commons.logging.Log log = 
org.apache.commons.logging.LogFactory.getLog(this.class);

if (log.isDebugEnabled()) 
  log.debug(getMessage( + locale + , + key + ));

(How can I enable/disable the Debug or Trace?)


Thank you in advance. I am really stuck and I couldnt make it to 
work. I am using tomcat 4.18


Rabih



-
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: common-logging, Struts, Log4j

2003-06-26 Thread Pingili, Madhupal

I have the similar setup and works very well for me.

log4j.appender.LOGFILE.File=outputfile.log where it is located? 
where I find it? is it physical file?
It should be saved under the app. server bin dir like c:/tomcat-4.18/bin.
I don't use tomcat. But websphere app. server saves this file under bin
folder.
If you want, you can give absolute path like
c:/tomcat-4.18/logs/outputfile.log.

log4j.rootLogger=DEBUG, rolling
Here you have not declared stdout as an appender.
So, all log messages (because you have lowest level DEBUG for rootLogger)
will be sent to file declared in rolling appender.

You can include stdout in rootLogger like 
log4j.rootLogger=DEBUG, stdout, rolling
and check your tomcat log files to see if there is anything written before
you check 
rolling file permissions etc.

Hope this helps.

Reddy

 Original Message-
 From: rablists [SMTP:[EMAIL PROTECTED]
 Sent: Thursday, June 26, 2003 8:51 AM
 To:   [EMAIL PROTECTED]
 Subject:  common-logging, Struts, Log4j
 
 Hi. I have problem in using the common-logging with struts and 
 Log4j. I am basically lost. I  have short questions, I appreciate if 
 anyone can help me little bit. these are the questions with examples:
 
 The file outputfile.log that I specify in 
 log4j.appender.LOGFILE.File=outputfile.log where it is located? 
 where I find it? is it physical file?
 
 I dont know why my configuration is not working, although I put the 
 following files in the classpath WEB-INF/classes/org/myclasses/:
 
 commons-logging.properties:
 org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL
 ogger
 
 log4j.properties:
 log4j.rootLogger=DEBUG, rolling
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%
 n
 log4j.appender.rolling=org.apache.log4j.RollingFileAppender
 log4j.appender.rolling.File=outputfile.log
 log4j.appender.rolling.MaxFileSize=100KB
 log4j.appender.rolling.MaxBackupIndex=1
 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
 log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p %
 c - %m%n
 
 What else should I specify, or configure to make it to work? I have 
 log4j-1.2.4.jar in my WEB-INF/lib/
 
 Should I set any system propreties? or web.xml? or struts-config? 
 
 In my classes I am doing that:
   protected static final org.apache.commons.logging.Log log = 
 org.apache.commons.logging.LogFactory.getLog(this.class);
 
 if (log.isDebugEnabled()) 
   log.debug(getMessage( + locale + , + key + ));
 
 (How can I enable/disable the Debug or Trace?)
 
 
 Thank you in advance. I am really stuck and I couldnt make it to 
 work. I am using tomcat 4.18
 
 
 Rabih
 
 
 
 -
 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: common-logging, Struts, Log4j

2003-06-26 Thread Markus Holzem
By default the property-files
 commons-logging.properties
 log4j.properties
are located in the directory WEB-INF/classes
Usually you put them in your workbench in the root of the Java Source 
directory. If you build with ant you simply copy them there from your 
chosen source directory

Markus

rablists wrote:

Hi. I have problem in using the common-logging with struts and 
Log4j. I am basically lost. I  have short questions, I appreciate if 
anyone can help me little bit. these are the questions with examples:

The file outputfile.log that I specify in 
log4j.appender.LOGFILE.File=outputfile.log where it is located? 
where I find it? is it physical file?

I dont know why my configuration is not working, although I put the 
following files in the classpath WEB-INF/classes/org/myclasses/:

commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL
ogger
log4j.properties:
log4j.rootLogger=DEBUG, rolling
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%
n
log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=outputfile.log
log4j.appender.rolling.MaxFileSize=100KB
log4j.appender.rolling.MaxBackupIndex=1
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p %
c - %m%n
What else should I specify, or configure to make it to work? I have 
log4j-1.2.4.jar in my WEB-INF/lib/

Should I set any system propreties? or web.xml? or struts-config? 

In my classes I am doing that:
 protected static final org.apache.commons.logging.Log log = 
org.apache.commons.logging.LogFactory.getLog(this.class);

   if (log.isDebugEnabled()) 
 log.debug(getMessage( + locale + , + key + ));

(How can I enable/disable the Debug or Trace?)

Thank you in advance. I am really stuck and I couldnt make it to 
work. I am using tomcat 4.18

Rabih



-
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]


  1   2   3   4   >