logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashraf Fouad" <ashraf_fo...@rayasoftware.com>
Subject RE: NOONE TO ANSWER ? sorry for the previous mail
Date Wed, 29 Jan 2003 13:12:19 GMT
Thankx too much for the reply

- I'm using Oracle JDeveloper 9i release 3, the newest version of Oracle JDeveloper, I used
the classpath settings several times without any complains.
- I tried also IBM Visual Age for Java 3.5.3 with jdk 1.2.2 & Log4J 1.2.7 the latest also
the same problem ?!?!?!? ==> it is not the problem of IDE.

- Thankx for the hint about getFile()   :)))))

Ashraf Fouad Ayoub
Senior Developer
Raya Software

1 Abdel Hameed Lotfy St.,
Nasr City, Cairo 11371, Egypt
Phone:	*	(202) 670-3301/2/3/4/6/8 Ext. 295
Fax:	*	(202) 670-3296
Email:	* ashraf_fouad@rayasoftware.com
Web:     * http://www.rayasoftware.com/


-----Original Message-----
From: Steve Ebersole [mailto:steveebersole@austin.rr.com]
Sent: Wednesday, January 29, 2003 2:30 PM
To: Log4J Users List
Subject: Re: NOONE TO ANSWER ? sorry for the previous mail


If #1 and #2 did not work, then the directory you think is in the classpath
is in fact not in the classpath.  When log4j initializes itself, it looks
for a config file named lo4j.properties in the classpath.

I would recheck what your IDE considers in the classpath versus not in the
class path.  Its not like this is a problem with log4j; this works for many
people in many places in many scenarios on many platforms, etc....




P.S., if you want the URL without the file:// URL protocol identifier, try
the URL.getFile() method (no need to do substringing on your own...).
String semiFullPath =
_my.getClass().getClassLoader().getResource( "xx_log4j.properties").getFile(
);




----- Original Message -----
From: "Ashraf Fouad" <ashraf_fouad@rayasoftware.com>
To: "Log4J Users List" <log4j-user@jakarta.apache.org>
Sent: Wednesday, January 29, 2003 4:58 AM
Subject: RE: NOONE TO ANSWER ? sorry for the previous mail


yes, xx_log4j.properties is the properties file defined in my IDE classpath.

I tried yr ways, and here is my results:

1- Trial of renaming the the file to log4j.properties (Didn't work):
log4j:ERROR Could not read configuration file [log4j.properties].
java.io.FileNotFoundException: log4j.properties (The system cannot find the
file specified. )
void java.io.FileInputStream.open(java.lang.String)
native code
void java.io.FileInputStream.<init>(java.lang.String)
FileInputStream.java:64
void org.apache.log4j.PropertyConfigurator.doConfigure(java.lang.String,
org.apache.log4j.spi.LoggerRepository)
PropertyConfigurator.java:297
void org.apache.log4j.PropertyConfigurator.configure(java.lang.String)
PropertyConfigurator.java:315 0
[main] INFO  com.rsw.test.MyAppProperty  - Entering application. 140
[main] DEBUG com.rsw.test.Bar  - Did it again! 140
[main] WARN  com.rsw.test.MyAppProperty  - Hello world all ante7 fentakes
140
[main] WARN  com.rsw.test.MyAppProperty  - Hello world all ante7 fentakes
150
[main] WARN  com.rsw.test.MyAppProperty  - Hello world all ante7 fentakes
150
[main] INFO  com.rsw.test.MyAppProperty  - Exiting application.
void com.rsw.test.MyAppProperty.main(java.lang.String[])
MyAppProperty.java:19
log4j:ERROR Ignoring configuration file [log4j.properties].
Process exited with exit code 0.

2- I tried to set the -D options but also didn't work

3- It worked :))), I used the following:
String l_szfull =
_my.getClass().getClassLoader().getResource( "xx_log4j.properties").toExtern
alForm();
// Delete the first 6 characters from the path to delete "file:/"
// Still u will have
"drive_name:/whatever/path/u/specify/xx_log4j.properties"
PropertyConfigurator.configure( fullPath.substring( 6 ) );

Thankx a lot Steven, but I feel that there is something wrong I use, as all
is using log4j & didn't face such problem I don't know why?
anyway it worked, I insisted on writing the code so that others can benifit
from it


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



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


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


Mime
View raw message