<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Perfect! That works out very well.<div><br></div><div>Thanks,</div><div>Jack<br><br><br><div><hr id="stopSpelling">From: tony19@gmail.com<br>Date: Tue, 13 Dec 2011 18:37:45 -0500<br>To: logback-user@qos.ch<br>Subject: Re: [logback-user] Enable Debugging Mode Programmatically?<br><br>There are a couple ways:<div><br></div><div>1) Use <a href="http://logback.qos.ch/apidocs/ch/qos/logback/core/util/StatusPrinter.html#printInCaseOfErrorsOrWarnings%28ch.qos.logback.core.Context%29" target="_blank">StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext)</a></div>

<div><br></div><div>OR</div><div><br></div><div>2) Load hard-coded string of configuration XML w/configuration.debug set to 'true':</div><div><br></div><div><div><span class="ecxApple-tab-span" style="white-space:pre">  </span>static final String LOGBACK_XML = </div>

<div><span class="ecxApple-tab-span" style="white-space:pre">           </span>"<configuration debug='true'>" + </div><div><span class="ecxApple-tab-span" style="white-space:pre">            </span>"  <appender name='FILE' class='ch.qos.logback.core.RollingFileAppender'>" +</div>

<div><span class="ecxApple-tab-span" style="white-space:pre">           </span>"    <file>foo.log</file>" +</div><div><span class="ecxApple-tab-span" style="white-space:pre">              </span>"    <append>true</append>" +</div>

<div><span class="ecxApple-tab-span" style="white-space:pre">           </span>"    <encoder>" +</div><div><span class="ecxApple-tab-span" style="white-space:pre">               </span>"      <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>" +</div>

<div><span class="ecxApple-tab-span" style="white-space:pre">           </span>"    </encoder>" +</div><div><span class="ecxApple-tab-span" style="white-space:pre">              </span>"  </appender>" +</div><div><span class="ecxApple-tab-span" style="white-space:pre">            </span>"  <root level='INFO'>" +</div>

<div><span class="ecxApple-tab-span" style="white-space:pre">           </span>"    <appender-ref ref='FILE' />" +</div><div><span class="ecxApple-tab-span" style="white-space:pre">             </span>"  </root>" +</div>

<div><span class="ecxApple-tab-span" style="white-space:pre">           </span>"</configuration>"</div><div><span class="ecxApple-tab-span" style="white-space:pre">                </span>;</div><div><span class="ecxApple-tab-span" style="white-space:pre"> </span></div>

<div><span class="ecxApple-tab-span" style="white-space:pre">   </span>static public void configLogback() {</div><div><span class="ecxApple-tab-span" style="white-space:pre">              </span>LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();</div>

<div>                try {</div><div>               JoranConfigurator configurator = new JoranConfigurator();</div><div>               configurator.setContext(lc);</div><div>               lc.reset();</div><div>            </div>

<div>               configurator.doConfigure(new ByteArrayInputStream(LOGBACK_XML.getBytes()));</div><div>           } catch (JoranException je) {</div><div>               je.printStackTrace(<span class="ecxs1">);</span></div>









<div>           }</div><div><br></div><div>           // you can also print the errors/warning explicitly (instead of debug='true' in xml)</div><div>           //StatusPrinter.printInCaseOfErrorsOrWarnings(lc);</div>









<div><span class="ecxApple-tab-span" style="white-space:pre">   </span>}</div></div><div><br><br><div class="ecxgmail_quote">On Tue, Dec 13, 2011 at 6:20 PM, Jack Vinijtrongjit <span dir="ltr"><<a href="mailto:juminoz@hotmail.com">juminoz@hotmail.com</a>></span> wrote:<br>

<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">
I ended up accessing BasicStatusManager directly to get the message out so I can at least see what's going on. Then I was able to figure out that some required configuration wasn't set for RollingPolicy object.<div>

<br></div><div>Please let me know if there is a way to make BasicStatusManager cough up all log messages for LogBack. Otherwise, I guess I just have to do it the way I'm doing now when things are not working.<br><div>

<br></div><div>Thanks,</div><div>Jack</div><div><br></div><div><div class="ecxhm ecxHOEnZb"><br></div></div></div></div></div></blockquote></div><br></div>
<br>_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user</div></div>                                       </div></body>
</html>