RE: log4j and WSAD 5.0 anomalies and problems

2003-02-11 Thread Cakalic, James P.
Of course, that code is only executed if the default Logger initialization from a 
properties file is not performed. Apparently, your log4j.properties file is not being 
found.

-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 10:16 AM
To: Log4J Users List
Subject: Re: log4j and WSAD 5.0 anomalies and problems


The culprit is the following code from 
org.apache.commons.logging.impl.Log4JCategoryLog

 private void initialize() {
 Category root=Category.getRoot();
 Enumeration appenders=root.getAllAppenders();
 if( appenders==null || ! appenders.hasMoreElements() ) {
 // No config, set some defaults ( consistent with
 // commons-logging patterns ).
 ConsoleAppender app=new ConsoleAppender(new PatternLayout( LAYOUT ),
 ConsoleAppender.SYSTEM_ERR 
);
 app.setName(commons-logging);

 root.addAppender( app );
 root.setPriority( Priority.INFO );
 }
 initialized=true;
 }

As you can see it sets the level (a.k.a. priority) of root logger (a.k.a. category) to 
INFO.

This problem has been reported as bug #13201 to commons-logging.
You may want to comment/vote on this bug at

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13201


At 10:58 11.02.2003 -0500, you wrote:
This is totally weird..
Check out the following test code:
try {
if (log.isDebugEnabled()) {
log.debug(About to log something 
 +log.isDebugEnabled());

}

}catch(IllegalStateException e) {
log.error(Something bad has happened:  + e);
}

log.info(Just Testing a log message with priority set to  DEBUG 
=+log.isDebugEnabled());
log.info(Just testing a log message with priority set to INFO =  + 
log.isInfoEnabled());
log.warn(Just testing a log message with priority set to WARN =  
 + log.isWarnEnabled());
log.error(Just testing a log message with priority set to ERROR = 
  + log.isErrorEnabled());
log.fatal(Just testing a log message with priority set to FATAL = 
 + log.isFatalEnabled());

And here is what the console tells me:
2/11/03 10:51:10:235 EST] 7ffa7525 SubsegListAct I 
com.ibm.lansys.actions.SubsegListAction  Just Testing a log message with priority 
set to DEBUG =false
[2/11/03 10:51:10:235 EST] 7ffa7525 SubsegListAct I 
com.ibm.lansys.actions.SubsegListAction  Just testing a log message with priority 
set to INFO = true
[2/11/03 10:51:10:235 EST] 7ffa7525 SubsegListAct W 
com.ibm.lansys.actions.SubsegListAction  Just testing a log message with priority 
set to WARN = true
[2/11/03 10:51:10:245 EST] 7ffa7525 SubsegListAct E 
com.ibm.lansys.actions.SubsegListAction  Just testing a log message with priority 
set to ERROR = true
[2/11/03 10:51:10:255 EST] 7ffa7525 SubsegListAct F 
com.ibm.lansys.actions.SubsegListAction  Just testing a log message with priority 
set to FATAL = true


So , now I know that my DEBUG is NOT enabledbut I do not know 
why.  It appears to me that log4j isnt even
being called anywhere..simply because 1) i tried changing 
ConversionPattern and so no changes on the console and 2) nothing is still being 
written to file.

Please, help, this is making me crazy!
Thanks, Lydia


Lydia P wrote:

Has anyone successfully got log4j running under the Websphere Studio 
Application Developer v 5.0?
I had to migrate my WSAD 4.03 application to WSAD 5.0, which has a 
totally different tree structure, but WSAD 5.0
is supposed to recognize and retain WSAD 4.03 structures.

I am not seeing log4j initialize in the console, yet, I see the class 
loggers append to the consolethe weird
thing is that I have them in the properties file logging to files - yet no files 
are being created.

Maybe I dont fully understand how WSAD works with commons-logging and 
log4j?  I didnt think I had
to use a log4j initializing servlet which is mentioned in web.xml to make it work 
- theoretically, my class
files should never have to change when I change logging tools?

Here is my setup:
I have commons-logging.jar and log4j-1.2.7.jar under the WEB-INF/lib 
directory.
My commons-logging.properties file in the /WEB-INF/classes directory :
# commons logging config - use Log4J
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog 


My log4j.properties file in the /WEB-INF/classes directory :

#  log4j configuration file
#   DEBUG, INFO, WARN, ERROR and FATAL
# Create three appenders, one called listout, one called stdout and 
another called R
log4j.logger.com.com.ibm.lansys.actions=DEBUG, listout, stdout, R
log4j.logger.org.apache=DEBUG, listout ,stdout, R

# Create root (default) appender -default DEBUG and higher msgs go to the console
log4j.rootCategory=DEBUG, stdout

RE: Log4C

2001-10-27 Thread Cakalic, James P.
Title: RE: Log4C





Haven't looked at it yet. How similar is it, do you think, to the C++ version at
http://sourceforge.net/projects/log4cpp/?



 -Original Message-
 From: (ti) Mark Mendel [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, October 25, 2001 4:12 PM
 To: [EMAIL PROTECTED]
 Subject: Log4C
 
 
 I just started a Sourceforge project for a C version.
 
 It includes an initial, feature-poor but working version.
 
 https://sourceforge.net/projects/log4c/
 
 Tell your friends and neighbors! Add your favorite feature! 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 





RE: Log4J in JSP??

2001-07-23 Thread Cakalic, James P.



Hmm. I 
try to avoid 'method repositories' where possible. I also try to put as little 
Java code in a JSP as possible. That way, I find that I don't often have much of 
interest to log from a JSP. Anyway, here are a couple 
suggestions.

First, 
why not have a look at the Jakarta Log Tag Library. It may be just what you 
need.
http://jakarta.apache.org/taglibs/doc/log-doc/log.html

If you 
want to develop your own class, you might consider designing a JavaBean that you 
could instantiate with page scope using the JSP useBean tag and use bean set 
tags to set its properties -- like the name for the Category. Your bean would 
have logging methods that duplicate those of Category. Itcould retrieve 
the Category instance based on its name property and delegate calls to the 
Category object.

Best 
regards,
Jim 
Cakalic

  -Original Message-From: Seemantini Godbole 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, July 23, 2001 
  10:27 AMTo: 'LOG4J Users Mailing List'Subject: RE: Log4J 
  in JSP??
  Sumit,
  
  You 
  may want to design a class with all static methods which will do logging to 
  log4j. It could have a method such as
  
  public static void doInfoLog(String catName, String 
  message)
  {
   Category cat = 
  Category.getInstance(catName);
  
   //log the message to this category
  }
  
  You 
  could use this class and method in your JSP.
  
  
  Thanks,
  seemantini
  
  
-Original Message-From: Sumit Mishra 
[mailto:[EMAIL PROTECTED]]Sent: Monday, July 23, 2001 
10:09 AMTo: '[EMAIL PROTECTED]'Subject: 
Log4J in JSP??

Hi 
guys,

This is my 
first message to this list..
I just 
wanted to figure out whether I could use log4j in JSPs for logging 
purpose?
I have 
already used log4j in Java class and 
EJBs.
Thanx in 
anticipation 

Sumit Mishra
Everyone makes mistakes. The trick is to 
make them when nobody is 
looking.

DISCLAIMER: The information contained in this 
message may be privileged and confidential and protected from disclosure. If 
the reader of this message is not the intended recipient, or an employee or 
agent responsible for delivering this message to the intended recipient, you 
are hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this 
communication in error, please notify us immediately by replying to the 
message and deleting it from your computer.
Thank you.
CashTech 
  Solutions.


RE: Category.assert() disappointing

2001-06-25 Thread Cakalic, James P.
Title: RE: Category.assert() disappointing





Of course, JUnit is a unit testing framework, not a logging framework.
:-o


 -Original Message-
 From: Benjamin Russell Stocum [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 25, 2001 1:43 PM
 To: LOG4J Users Mailing List
 Subject: Re: Category.assert() disappointing
 
 
 Has anyone looked at JUnit? This is where you want to get 
 all your asserts
 from :)
 Duplication is not necessary if its already done, and done 
 right at that I
 might add.
 
 -Ben Stocum
 
 





RE: how can install tomcat as a service in Win 2000

2001-06-15 Thread Cakalic, James P.
Title: RE: how can install tomcat as a service in Win 2000





Not really a log4j question, but in the true community spirit ...


Have a look at the Jakarta NT Service page
 http://jakarta.apache.org/tomcat/tomcat-3.2-doc/NT-Service-howto.html


and also the Alexandria Software JavaService tool which is referenced there
 http://www.alexandriasc.com/software/JavaService/index.html


Between what is provided with Tomcat (usable on JDK 1.2) and the Alexandria JavaService (open source NT service Java invoker for JDK 1.3), you should be set. I haven't used these to run Tomcat, but I have used JavaService to run other Java applications as services. Running a Java application that is an IBM WebSphere EJB client is no simple task. Try running it as an NT/2000 service! JavaService performed wonderfully. (No personal connection to the company. Just a satisfied and grateful user.)

Best regards,
Jim Cakalic


 -Original Message-
 From: sancho george [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 15, 2001 5:04 AM
 To: [EMAIL PROTECTED]
 Subject: how can install tomcat as a service in Win 2000
 
 
 i have tomcat3.2.1 . i have to run the server in the
 background .
 please help
 
 __
 Do You Yahoo!?
 Spot the hottest trends in music, movies, and more.
 http://buzz.yahoo.com/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 





RE: help with Wrapping/Buffering

2001-04-11 Thread Cakalic, James P.
Title: RE: help with Wrapping/Buffering





Hi, Ross.


Have a look at the source for org.apache.log4j.spi.LocationInfo.


Best regards,
Jim Cakalic


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 10, 2001 5:19 AM
 To: [EMAIL PROTECTED]
 Subject: help with Wrapping/Buffering
 
 
 Hi there, 
 I've just started using log4j (and am still a newbie to java 
 itself).I am using a wrapper class around log4j, and part of 
 what my wrapper does is to buffer log items, only sending 
 them to log4j when certain events occur. Clearly by doing 
 this, I lose log4j's ability to automatically retrieve 
 methods, line numbers etc. from the caller.
 
 It seems like what I have to do is to retrieve this 
 information before I add an individual log to the buffer, 
 then send it as part of the message string to log4j. 
 Obviously I would lose some flexibility in the PatternLayout 
 function, but this is not crucial. 
 
 I understand that log4j somehow gets this information from a 
 stack trace, but I am unsure of exactly how this works, or 
 how I would go about getting the information for myself.
 
 Thanks in advance for any help,
 
 Ross Ovland
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 





RE: Formatting NT Event log

2001-03-26 Thread Cakalic, James P.
Title: RE: Formatting NT Event log





The NTEventLogAppender could probably use some work, seeing as it doesn't currently support options. The only way, then, to set the event source is by virtue of one of the alternate constructors which permits specifying the source. The constructor will register the source. The category and event cannot currently be set. Adding the ability to set them could be problematic as there message resources must be delivered in a DLL and properly specified in the NT registry.

Best regards,
Jim Cakalic


 -Original Message-
 From: Srinivasa Chinimilli (Rapidigm)
 [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 26, 2001 4:16 PM
 To: 'LOG4J Users Mailing List'
 Subject: RE: Formatting NT Event log
 
 
 Even I was looking for that. I posted about the same query 
 couple of weeks
 back, but I didn't get any response.
 Please let us know if anyone know how to modify them.
 
 thanks,
 srinivas
 
 -Original Message-
 From: Anderson, Bob [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 26, 2001 11:39 AM
 To: [EMAIL PROTECTED]
 Subject: Formatting NT Event log
 
 
 When using LOG4J for sending messages to an NT event log I 
 would like to set
 the Source, Event ID, Category. Has anyone got this to work. 
 If so can you
 show an example.
 
 Thanks,
 
 - Bob 
 
 -
 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]