<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'>
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><br><br><div><hr id="stopSpelling">From: juminoz@hotmail.com<br>To: logback-user@qos.ch<br>Date: Tue, 13 Dec 2011 16:41:27 -0600<br>Subject: Re: [logback-user] Enable Debugging Mode Programmatically?<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>

<div dir="ltr">
Thanks guys.<div><br></div><div>Both suggestions actually didn't work for me. I tried with obvious configuration that is supposed to log some error message such as not setting RollingPolicy to a RollingFileAppender and it's still not printing anything out at all.</div><div><br></div><div><p style="margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font class="ecxApple-style-span" color="#17365d">    if (rollingPolicy == null) {</font></p>
<p style="margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font class="ecxApple-style-span" color="#17365d">      addError("No RollingPolicy was set for the RollingFileAppender named "</font></p>
<p style="margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font class="ecxApple-style-span" color="#17365d">          + getName());</font></p>
<p style="margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font class="ecxApple-style-span" color="#17365d">      addError("For more information, please visit "+CODES_URL+"rfa_no_rp");</font></p>
<p style="margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font class="ecxApple-style-span" color="#17365d">      return;</font></p>
<p style="margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><font class="ecxApple-style-span" color="#17365d">    }</font></p><div><br></div>I traced through and addError() method invoking addStatus() method in ContextAwareBase, which the invokes StatusManager. It looks like BasicStatusManager has log level set to INFO level by default so these error messages should have really shown up.</div><div><br></div><div>I still can't get RollingFileAppender to work and it would great to see why it doesn't work.</div><div><br></div><div>Thanks,</div><div>Jack</div><div><br><br><div><hr id="ecxstopSpelling">From: onlymed@hotmail.com<br>To: logback-user@qos.ch<br>Date: Tue, 13 Dec 2011 22:20:34 +0100<br>Subject: Re: [logback-user] Enable Debugging Mode Programmatically?<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>

<div dir="ltr">
Hello Andrew, <br><br>For the root level you can do something like this : <br><br>((Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(Level.toLevel("DEBUG"));<br><br><br><div>> From: andrew.bourgeois@hotmail.com<br>> To: logback-user@qos.ch<br>> Date: Tue, 13 Dec 2011 21:42:25 +0100<br>> Subject: Re: [logback-user] Enable Debugging Mode Programmatically?<br>> <br>> Hello Jack<br>> <br>> I don't know how to do it for the rootLogger, but here's how I did enable a <br>> debug level for my whole app:<br>> LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();<br>> lc.getLogger("be.mydomain.testapp").setLevel(Level.DEBUG);<br>> <br>> Using the following imports:<br>> import org.slf4j.LoggerFactory;<br>> import ch.qos.logback.classic.Level;<br>> import ch.qos.logback.classic.LoggerContext;<br>> <br>> If anyone knows how to do it for the rootLogger, please let me know (as it <br>> can be annoying to enable debug logs for every package of the <br>> dependencies...).<br>> <br>> Best regards<br>> <br>> Andrew<br>> <br>> -----Original Message----- <br>> From: juminoz<br>> Sent: Tuesday, December 13, 2011 12:14 AM<br>> To: logback-user@qos.ch<br>> Subject: [logback-user] Enable Debugging Mode Programmatically?<br>> <br>> <br>> I was wondering if there is a way to enable debug mode programmatically.<br>> Since I'm not allowed to use configuration file, I'm currently configure<br>> everything programmatically. Recently, I ran into an issue where<br>> RollingFileAppender stop writing to file though FileAppender works perfectly<br>> fine. In fact, RollingFileAppender was also working last week and nothing<br>> that I'm aware of has changed since.<br>> <br>> Please let me know if there is a way to enable debug since doing it using<br>> configuration file (logback.xml) doesn't seem to be working.<br>> <br>> Thanks,<br>> Jack<br>> -- <br>> View this message in context: <br>> http://old.nabble.com/Enable-Debugging-Mode-Programmatically--tp32961424p32961424.html<br>> Sent from the Logback User mailing list archive at Nabble.com.<br>> <br>> _______________________________________________<br>> Logback-user mailing list<br>> Logback-user@qos.ch<br>> http://mailman.qos.ch/mailman/listinfo/logback-user <br>> <br>> _______________________________________________<br>> Logback-user mailing list<br>> Logback-user@qos.ch<br>> http://mailman.qos.ch/mailman/listinfo/logback-user<br></div>                                        </div>
<br>_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user</div></div>                                       </div>
<br>_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user</div></div></div>                                           </div></body>
</html>