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 Ashraf Fouad <as...@rayasoftware.com> on 2003/01/29 11:58:22 UTC

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 = l_my.getClass().getClassLoader().getResource( "xx_log4j.properties").toExternalForm();
// 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


Re: NOONE TO ANSWER ? sorry for the previous mail

Posted by Eduardo Ito <ed...@yahoo.com>.
> ----- Original Message -----
> From: "Ashraf Fouad" <as...@rayasoftware.com>
> To: "Log4J Users List" <lo...@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.

You must put the DIRECTORY where xx_log4j.properties is located, not
the file itself.


=====
<Eduardo Issao Ito/>
<Summa Technologies/>

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


Re: NOONE TO ANSWER ? sorry for the previous mail

Posted by Steve Ebersole <st...@austin.rr.com>.
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" <as...@rayasoftware.com>
To: "Log4J Users List" <lo...@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