You cannot hot deploy because the classes are then loaded by the classloader which loaded weblogic itself (i.e., typically the jvm main classloader). Hot deployment depends on the ability to destroy and "throw away" an entire classloader. This goes to how j2ee apps are deployed within their targetted container. There's lots of docs around if you are interested in how this happens.
As a side note, you can still hot redeploy your apps. Its just that logging may or may not get screwed up in that option #1 when hot redeploy. -----Original Message----- From: Andreas Bothner [ MTN - Innovation Centre ] [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 6:54 AM To: Log4J Users List Subject: RE: newbie: configuring log4j for EJB's inside weblogic Thanks Steve, I would appreciate you sending me your servlet code... Why did you say that you cannot use hot-deploy in option #1 ??? Is it possible to have a combination of both options??? -----Original Message----- From: Steve Ebersole [mailto:[EMAIL PROTECTED] Sent: Thursday, 31 July 2003 13:29 To: Log4J Users List Subject: RE: newbie: configuring log4j for EJB's inside weblogic >> do you have to include the log4j.jar in every ear file? yes >> What does the environment entry refer to? It simply defines where to find the config file. The other option here is to allow each ear file have its copy of log4j.jar and its log4j.xml/properties in the ear on the classpath. Then no explicit congifuration code is needed (log4j will find the config file and configure itself). >> Could you share the servlet code? If you need, I can include it verbatim when I get to work. Its really using DOMConfigurator.configure()/configureAndWatch() inside the init method. The servelt is mapped to load-on-startup inside its web.xml file. -----Original Message----- From: Andreas Bothner [ MTN - Innovation Centre ] [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 3:53 AM To: Log4J Users List Subject: RE: newbie: configuring log4j for EJB's inside weblogic Hi Steven, Thank you for the response. I thought of writing a startup class because in option #1 the code PropertyConfigurator.configureAndWatch() has to be called somewhere, once instead of each application doing it. Could you give me more info on option #2 ... do you have to include the log4j.jar in every ear file? Could you share the servlet code? What does the environment entry refer to? Regards, Andreas -----Original Message----- From: Ebersole, Steven [mailto:[EMAIL PROTECTED] Sent: Wednesday, 30 July 2003 19:16 To: 'Log4J Users List' Subject: RE: newbie: configuring log4j for EJB's inside weblogic I've done two seperate setups for configuring log4j on weblogic (both are 6.1sp4). #1 log4j.jar and its config file on the server classpath (i.e., the classpath built in startWebLogic.sh) #2 Each enterprise deployable handling its own config. In my ear, this is accomplished by including a war file with just a single servlet whose sole purpose is to configure log4j from an env-entry. Option #1 is serviceable but not very flexible. All classes running within that server must then use that configuration. And further more, you will not be able to hot-deploy components. Why write a startup class (i.e., weblogic startup class as opposed to starup servlet) to acheive this? #1 does the same thing... -----Original Message----- From: Andreas Bothner [ MTN - Innovation Centre ] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 12:05 PM To: [EMAIL PROTECTED] Subject: newbie: configuring log4j for EJB's inside weblogic Hi, I would prefer not to put the log4j jar file into each EJB application jar file, so I have tried to put the log4j jar into the classpath and then simply start the app server. I expected my EJB's to find the Logger class, but was disappointed to get a ClassNotFound Exception. Is it possible to use log4j without deploying the jar with each application jar? The other question I have is when to configure log4j. I think it would be overkill to put this code into each EJB implementation. Would I be right in thinking that I should create a startup class that the application server runs when booting and that this class must call the configureAndWatch() method??? Regards, Andreas --------------------------------------------------------------------- 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]