<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span>As slf4j does not deal with configuration there is no way to deal with this at the slf4j level.&nbsp;</span></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><br></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span></span></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><br></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span>Logging at debug level is the correct default. It always used to annoy me that log4j didn't log anything if it couldn't find any config.&nbsp;</span></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><br></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span></span></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><br></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span>If the 'customers' of your framework know enough to put logback on the classpath but yet don't know how to configure it, then my mind boggles. Do they also complain to you when they run out of disk space?</span></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><br></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span></span></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><br></span><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; "><span>David</span></span><br><br>On 28 Apr 2011, at 14:08, lilyevsky &lt;<a href="mailto:lilyevsky@mooncapital.com">lilyevsky@mooncapital.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><span></span><br><span>Thanks Jeff,</span><br><span></span><br><span>I know how to make it find the configuration in various ways, this is not a</span><br><span>problem.</span><br><span>My problem is different: how to make my code behave in a sensible way when</span><br><span>it is not under my control.</span><br><span></span><br><span>Here is the scenario. I write some library that will be used by others, I</span><br><span>use slf4j for my logging,</span><br><span>and I have debug output in many places.</span><br><span>I would have more control on the library if I produced it as a jar (ideally</span><br><span>built by maven), but </span><br><span>unfortunately in current situation it may be used on the source code level.</span><br><span>I mean, the other</span><br><span>developer will compile it together with the other stuff, using naked javac.</span><br><span></span><br><span>After that, at runtime, if the configuration is not provided, the debug</span><br><span>problem comes up.</span><br><span></span><br><span>As I mentioned, I have the solution (default configuration with WARN level</span><br><span>is hard-coded), but I don't </span><br><span>quite like it because now my code suddenly is aware of logback, instead of</span><br><span>just pure slf4j.</span><br><span></span><br><span>Basically, my complaint is this: why by default logback goes to DEBUG level,</span><br><span>not to INFO</span><br><span>or even WARN?</span><br><span></span><br><span>At least, this could be controlled by a Java system property.</span><br><span></span><br><span></span><br><span></span><br><span>Jeff Jensen-2 wrote:</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Place a Logback XML config file on the classpath. &nbsp;I've done this in</span><br></blockquote><blockquote type="cite"><span>many apps without a problem. &nbsp;You must've done this and it's not found</span><br></blockquote><blockquote type="cite"><span>(is that what you mean by "cannot find configuration file anywhere")?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>On Thu, Apr 28, 2011 at 7:29 AM, Leonid Ilyevsky</span><br></blockquote><blockquote type="cite"><span>&lt;<a href="mailto:lilyevsky@mooncapital.com">lilyevsky@mooncapital.com</a>&gt; wrote:</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>When logback cannot find configuration file anywhere, it sets the default</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>to</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>send everything to standard output and the level is set to DEBUG.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>This creates a big problem in our production environment: super-verbose</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>log</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>that is even difficult to look at.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>My solution was to create a small wrapper using JoranConfigurator. This</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>works great, and I can do whatever I need.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>However, here is the downside: my code is no longer ignorant of logback.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Previously it was purely slf4j everywhere, but now every class is</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>indirectly</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>dependent on logback stuff (though it is limited to 2 lines in every java</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>file). This defeats the purpose of slf4j as pure facade.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Is there any better solution?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Our problem is, we need to guarantee that no matter what happens in the</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>logging layer, it should never go wild and produce all that debugging</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>noise.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>________________________________</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>This email, along with any attachments, is confidential and may be</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>legally</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>privileged or otherwise protected from disclosure. Any unauthorized</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>dissemination, copying or use of the contents of this email is strictly</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>prohibited and may be in violation of law. If you are not the intended</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>recipient, any disclosure, copying, forwarding or distribution of this</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>email</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>is strictly prohibited and this email and any attachments should be</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>deleted</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>immediately. This email and any attachments do not constitute an offer to</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>sell or a solicitation of an offer to purchase any interest in any</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>investment vehicle sponsored by Moon Capital Management LP (“Moon</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Capital”).</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Moon Capital does not provide legal, accounting or tax advice. Any</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>statement</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>regarding legal, accounting or tax matters was not intended or written to</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>be</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>relied upon by any person as advice. Moon Capital does not waive</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>confidentiality or privilege as a result of this email.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>_______________________________________________</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Logback-user mailing list</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span><a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span><a href="http://qos.ch/mailman/listinfo/logback-user">http://qos.ch/mailman/listinfo/logback-user</a></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>Logback-user mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a></span><br></blockquote><blockquote type="cite"><span><a href="http://qos.ch/mailman/listinfo/logback-user">http://qos.ch/mailman/listinfo/logback-user</a></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span></span><br><span>-- </span><br><span>View this message in context: <a href="http://old.nabble.com/Why-DEBUG-by-default--tp31491746p31496279.html"><a href="http://old.nabble.com/Why-DEBUG-by-default--tp31491746p31496279.html">http://old.nabble.com/Why-DEBUG-by-default--tp31491746p31496279.html</a></a></span><br><span>Sent from the Logback User mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.</span><br><span></span><br><span>_______________________________________________</span><br><span>Logback-user mailing list</span><br><span><a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a></span><br><span><a href="http://qos.ch/mailman/listinfo/logback-user">http://qos.ch/mailman/listinfo/logback-user</a></span><br></div></blockquote></body></html>