<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'>
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></body>
</html>