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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In log4j, Ceki Gulcu (the author) suggests XML configuration over text file, and it takes precedence in default initialization, too (
log4j.xmloverlog4j.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 theDOMConfiguratorsource 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).