Hey all -
 
Just starting to get my hands dirty w/ Log4J and feel like I'm missing some basic points when reading the thru the FAQ, Archives, manuals, et al.
 
Specifically, at present, I'm looking to setup an application to test the functionality of the logging framework and do a general proof-of-concept to see how it fits in w/ our development process here.
 
I'm wanting to go the route of configuring the logging framework via the XML "properties" file w/ the following reservations:
 
When looking through the example code provided, I notice that the example-classes each have static Category vars which are _the_ categories used for logging (which are declared and defined w/in the declaration statements).  However, these classes also include calls to BasicConfigurator<or a subclass>.configure() or .configure(String configFile).  As I understand, the Log4J framework will maintain the instances of the various categories such that separate calls to Category.getInstance(<instance-name>) will _always_ return the same instance for that particular name.
 
Now, as I also understand it, when a class is first referenced, its static var's are instantiated at that time.  For the sake of argument, assume that I have static Category object defined for each class _and_ my .xml properties file provides the actual (full) definitions for these, i.e. including the Appender definition, file locations, etc.
 
So, up to the point of my calling the "appropriate" .configure() method, the static Category for each class will be just a "generic" Category, yes?
 
Also, when .configure() is called, will the current "generic" Category definition(s) be replaced w/ those in the .xml properties file (thereby ensuring a single Category instance for each <instance-name>)?
 
Also, in the archive I came across a posting looking for a better reference to explain the DTD for the .xml properties file, but saw no responses.  Does anyone have such a reference? Of concern, I notice that the DTD - for all its comments - does not provide explanations for, say, the "Threshold" param on <appender/> or the "Additivity" param on <configuration> (or I think its on <configuration/>, I actually haven't been able to verify this yet.
 
Soo, errr, any comments regarding my assumptions are, as always, greatly appreciated.
mx.
 
"When a relationship is not built on mutual respect,
 the only way of maintaining control is through brutal force."
 -- Roger Fouts

Reply via email to