logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ebersole, Steven" <steven.ebers...@vignette.com>
Subject RE: Uncaught exception in PropertyConfigurator - log4j1.2.8 ?
Date Fri, 01 Aug 2003 17:35:43 GMT
Try setting the System property "log4j.debug" to true; typically this is
done using -Dlog4j.debug=true.  The other option would be to slightly alter
the main as follows:

public static void main( String[] args )
{
    System.setProperty( "log4j.debug", "true" );
    try
    {
        PropertyConfigurator.configure( args[0] );
    }
    catch( Exception e )
    {
        BasicConfigurator.configure();
    }

    System.out.println("After catch block never reached!");
}


Log4j will then output all kinds of helpful information as it tries to
configure itself...

Also, what do you mean by "crash"?  If your getting an exception, how about
cutting and pasting the stack trace here so we can see whats happening.



-----Original Message-----
From: Desai, Chetan P [ITS] [mailto:Chetan.P.Desai@mail.sprint.com]
Sent: Thursday, July 31, 2003 4:35 PM
To: log4j-user@jakarta.apache.org
Subject: Uncaught exception in PropertyConfigurator - log4j1.2.8 ?


I tried searching the mailing list but did not find a solution to the
following issue I face which causes my code to crash:
 a) If the filename specified in args[0] does not exist
 b) If there are syntax errors in the contents of the Configuration files
specified by args[0]

Any help/pointers will be appreciated.

==========================================
 public static void main(String[] args) {
	try {
	 	PropertyConfigurator.configure(args[0]);
	}catch(Exception e) {
		BasicConfigurator.configure();
	}

	System.out.println("After catch block never reached!");
 }
==========================================

-Chetan desai.

---------------------------------------------------------------------
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