Well, it depends what your config file looks like. Also, sounds like you are
using JBoss. I think the classloader is server-wide, correct? Therefore, you
are using a single instance of Log4j and, thus, utilizing a single Logger
repository. So, whenever you perform configuration from any app runnng under
JBoss, you are reconfiguring the logging configuration for the whole server.
This can be worked around either using classloader tricks, like enabling
child-first loading for webapps (such as is the default in Tomcat-standalone)
or you can use a custom logger repository selector, which selects based on
something like JNDI context, which should be different per/webapp. Search the
list. I (and others) have written ad-nauseum about this.
Jake
On Tue, 1 Jul 2008 19:19:51 +0530
<[EMAIL PROTECTED]> wrote:
Hi
I have noticed that while I try to configure Log4j using Apach Log4j API
in an initialization servlet in my web application. It sort of stops
displaying the other statements that are by default displayed usually.
(i.e. Started J2EE application ....... and so on and so forth.. ). These
are not getting displayed on the console of JBoss, and are being written
into the log files that I am creating.
Following is my initializeLogger method of my logger manager, it is
being called from a servlet that gets loaded during startup from the
init method. Attached is the properties file. (FYI, I am using Struts
2.0 - though it should not matter). Any help is appreciated.
/*******************************************************************/
public static boolean initializeLogger(String strLog4jPropertyFileName)
{
Properties objLog4jProperties = new Properties();
try{
System.out.println(strLog4jPropertyFileName);
FileInputStream objFIS = new
FileInputStream(strLog4jPropertyFileName);
objLog4jProperties.load(objFIS);
objFIS.close();
PropertyConfigurator.configure(objLog4jProperties);
logger =
getInstance("com.wipro.eenabling.emobility.utility.logutil.LoggerMgr");
} catch(IOException objIOExp){
System.out.println("IO Exception occurred while loading the log4j
properties file"+objIOExp);
objIOExp.printStackTrace();
}catch(Exception objExp){
System.out.println("Exception occurred while loading the log4j
properties file"+objExp);
objExp.printStackTrace();
}
return true;
}
/*******************************************************************/
Regards
Ahmad
Please do not print this email unless it is absolutely necessary.
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 proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted by this
email.
www.wipro.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]