logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Skeet" <jon.sk...@peramon.com>
Subject RE: relative path for properties file
Date Tue, 11 Sep 2001 08:44:06 GMT
> Great thanks for the tip!
> 
> I ran into one problem though.  Since I am initializing the 
> configurator
> in the static block of my code I don't have access to the non-static
> method getClass().

Ah - in that case you know for sure which class you're in (as it won't
be called polymorphically) so you can just use com.foo.MyClass.class
instead of getClass().

> Where do most typically initialize their log4j configurators? 
> and how do you check your properties file in to revision control such 
> that they can be accessed by people who have different project 
> directories?

We personally use a logfile name of ${logfile} and set a system property
depending on the configuration. That way no-one (including customers)
needs to change the properties files under normal conditions (we ship 3
of them, one for each of "quiet", "verbose", or "troubleshooting"
operation, and have a mechanism to pick between them).

Jon



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


Mime
View raw message