Is it possible to programmatically configure log4cpp?
I want to configure it as it would be configured by supplying the following config file.
appender root basic console
priority root DEBUG
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.
Do you mean log4cpp from http://sourceforge.net/projects/log4cpp/ ?
The short answer is yes.
Here are some sample codes, and you can figure out more details based on its doc:
My codes are used to configure file-based log4cpp instance at run-time.
“priority” is ‘DEBUG’, …
“name” here is ‘root’
“layout” could be “%d{%Y-%m-%d %H:%M:%S}%c %x: %m%n”