You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Vivian, Nigel (N.)" <nv...@ford.com> on 2003/04/07 15:50:10 UTC

log4j and WSAD

Hi all

sorry for this newbie post but how does one get log4j recognising its
properties file in Websphere Studio 4.0.3

I've got
...
   public static String defaultConfigurationFile = "log4j.properties";
...
   public static GlobalLogger getInstance(Class clazz){
	  cat = Category.getInstance(clazz);
	  PropertyConfigurator.configure(defaultConfigurationFile);

	  if (createdFlag == false){
		  log = new GlobalLogger();
		  createdFlag = true;
	  }
	  return log;
   }

in  GlobalLogger in my web app

and 
...
	static GlobalLogger log  =
GlobalLogger.getInstance("someclassname");
...

in my action class

the properties file is in webapp\WEB-INF\classes\log4j.properties

but I get
log4j:ERROR Could not read configuration file [log4j.properties].
java.io.FileNotFoundException: log4j.properties (The system cannot find the
file specified)
...
when I access the Action object

Not sure how to get the classes dir on the classpath I would assume that it
is automatically there as it is the target of the build output process

TIA
Nigel Vivian

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org