logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ahmadbasha.sh...@wipro.com>
Subject Facing a problem while configuring the Log4j
Date Tue, 01 Jul 2008 13:49:51 GMT
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

Mime
View raw message