Turn off the verbose message from logback

Hello: I am programatically configuring Logback however providing two properties that our client can set to change the Log Level and root folder to generate logs at runtime. But, my problem is that Logback framework is giving me a some verbose message that I have copied below for every execution of the problem that I should not be displaying on the console. Is there any way to turn off this message? I tried debug="true" for <configuration .../> tag but did not work. Any help will be highly appreciated. The verbose message I gets:- 9:44:22,872 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 09:44:22,872 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [/bin/logback.xml] 09:44:22,935 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set 09:44:22,935 |-ERROR in ch.qos.logback.core.joran.action.PropertyAction - In <property> element, either the "file" attribute alone, or the "resource" element alone, or both the "name" and "value" attributes must be set. 09:44:22,935 |-ERROR in ch.qos.logback.core.joran.action.PropertyAction - In <property> element, either the "file" attribute alone, or the "resource" element alone, or both the "name" and "value" attributes must be set. Thanks. -- View this message in context: http://www.nabble.com/Turn-off-the-verbose-message-from-logback-tp25361264p2... Sent from the Logback User mailing list archive at Nabble.com.

Hello, From the messages below, it looks like logback could find the file [/bin/logback.xml] for auto-configuration. Moreover, that file contains errors which prompts logback to dump its internal state on the console. Either removing the bin/logback.xml file from the class path *or* correcting the errors associated with the <property> element should prevent logback from printing its internal state on the console. HTH, prpaudel wrote:
Hello: I am programatically configuring Logback however providing two properties that our client can set to change the Log Level and root folder to generate logs at runtime. But, my problem is that Logback framework is giving me a some verbose message that I have copied below for every execution of the problem that I should not be displaying on the console. Is there any way to turn off this message? I tried debug="true" for <configuration .../> tag but did not work. Any help will be highly appreciated.
The verbose message I gets:-
9:44:22,872 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 09:44:22,872 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [/bin/logback.xml] 09:44:22,935 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set 09:44:22,935 |-ERROR in ch.qos.logback.core.joran.action.PropertyAction - In <property> element, either the "file" attribute alone, or the "resource" element alone, or both the "name" and "value" attributes must be set. 09:44:22,935 |-ERROR in ch.qos.logback.core.joran.action.PropertyAction - In <property> element, either the "file" attribute alone, or the "resource" element alone, or both the "name" and "value" attributes must be set.
Thanks.
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch

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 Gulcu wrote:
Hello,
From the messages below, it looks like logback could find the file [/bin/logback.xml] for auto-configuration. Moreover, that file contains errors which prompts logback to dump its internal state on the console.
Either removing the bin/logback.xml file from the class path *or* correcting the errors associated with the <property> element should prevent logback from printing its internal state on the console.
HTH,
prpaudel wrote:
Hello: I am programatically configuring Logback however providing two properties that our client can set to change the Log Level and root folder to generate logs at runtime. But, my problem is that Logback framework is giving me a some verbose message that I have copied below for every execution of the problem that I should not be displaying on the console. Is there any way to turn off this message? I tried debug="true" for <configuration .../> tag but did not work. Any help will be highly appreciated.
The verbose message I gets:-
9:44:22,872 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 09:44:22,872 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [/bin/logback.xml] 09:44:22,935 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set 09:44:22,935 |-ERROR in ch.qos.logback.core.joran.action.PropertyAction - In <property> element, either the "file" attribute alone, or the "resource" element alone, or both the "name" and "value" attributes must be set. 09:44:22,935 |-ERROR in ch.qos.logback.core.joran.action.PropertyAction - In <property> element, either the "file" attribute alone, or the "resource" element alone, or both the "name" and "value" attributes must be set.
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
-- View this message in context: http://www.nabble.com/Turn-off-the-verbose-message-from-logback-tp25361264p2... Sent from the Logback User mailing list archive at Nabble.com.

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

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
-- View this message in context: http://www.nabble.com/Turn-off-the-verbose-message-from-logback-tp25361264p2... Sent from the Logback User mailing list archive at Nabble.com.

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
participants (2)
-
Ceki Gulcu
-
prpaudel