
You could comment out the <property> elements and let the use define them at a later time if desired. Since you are already using the <property> element, you are obviously already familiar with variable substitution [1]. There is an additional concept called "default substition values for variables" [2] which you might find interesting. It allows a default value for a variable to be defined in the config file while still allowing it to be overridden at a later time. There is also an example in the FAQ [3] similar to what you are trying to achieve (letting the user pick the log level for the application). These are just possibilities. They may or not may not be applicable in your situation. Cheers, [1] http://logback.qos.ch/manual/configuration.html#variableSubstitution [2] http://logback.qos.ch/manual/configuration.html#defaultValuesForVariables [3] http://logback.qos.ch/faq.html#overrideFromCL prpaudel wrote:
I provide a default configuration programatically but still allows client to change some settings for configuration like root folder to generate logs and Log Level for application.
Ceki Gulcu wrote:
Hello,
Why do you need to declare <property> elements in logback.xml that you are not going to use, or are not defining properly? Why not just remove the <property> elements from logback.xml?
prpaudel wrote:
Hello:
Since, I was configuring my log programatically I don't want to set any values for those two properties on logback.xml and Logback was complaning about it. But, I found a simple trick to stop complaning by putting a single white space as value for both of them.
Thanks.
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch