I'm just discovering log4cxx logging framework. It seems there are two different syntaxes for writing config file:
xml manner
key-value manner
Is there a difference or a best practice in this two approaches?
In log4j, Ceki Gulcu (the author) suggests XML configuration over text file, and it takes precedence in default initialization, too (log4j.xml
over log4j.txt
). You can achieve slightly more with XML configuration than with the text file (I think you cannot manipulate logger additivity and set log4j debug mode with text file configuration).
That said, log4cxx first looks for log4cxx.xml
, too, but there are hardly any examples of configuration on the net (and no official documentation, either), so you'll probably need to analyse the DOMConfigurator
source code to find out what's possible (referring to log4j examples may prove misleading, as it's not always exactly the same thing).
To conclude, log4cxx popularity in C++ world does not even come close to log4j's in Java. I wonder why (and what the heck IS popular there, except for tons of ad-hoc solutions).