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 Kwok Peng Tuck <pe...@makmal.net> on 2003/06/03 01:57:54 UTC

Re: PropertyConfigure

If you assume the properties file to be in the current directory of the 
class you load it from and run it from the command line then your 
assumption is correct, the properties file will be found, because the 
current working directory of the jvm is the directory you launch the 
class from. If testing from an IDE, the working directory is the IDE's 
so it is looking for it in the incorrect place. You can correct this by 
passing an argument to your main class where you can specify the full 
path of the properties file, then attempt to load the file.
So on loading in a command line you can do this :
                java  mymain /home/yoke/props/log4j.properties
And in the mymain main method, just process the arguments to get the 
string you want.


Tan Yoke Yew wrote:

>--error--
>log4j:WARN No appenders could be found for logger
>(com.infopro.util.ptr.FormDocument).
>log4j:WARN Please initialize the log4j system properly.
>--end --
>
>i am having these error when i run my java application. i am using
>Eclipse
>IDE to run it.
>
>however, i create a simple single hello java application and it doens't
>return me any error.
>
>as i suppected, i think my PropertyConfigure didnt specify correctly.
>therefore, instead of put the PropertyConfigurator.configure(config) in
>my
>java application, i wish to put it externally (like in my VM ARGUMENT).
>
>may i know how to set there?
>
>
>Regards;
>yoke yew
>
>
>---------------------------------------------------------------------
>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