[logback-user] Change log level at runtime
Nikolas Everett
nik9000 at gmail.com
Wed Jul 8 15:36:26 CEST 2009
On Wed, Jul 8, 2009 at 9:19 AM, Ceki Gulcu <ceki at qos.ch> wrote:
>
>
> Nikolas Everett wrote:
>
>> You can do that. See here: http://logback.qos.ch/manual/jmxConfig.html I typically change my logback configuration file on the file system then
>> use jconsole to request that logback reload it.
>> You may have to jump through some hoops to get jconsole to connect to a
>> running application server. I stuff these in my .bashrc on development box
>> to make it simple:
>> CATALINA_OPTS="-Dcom.sun.management.jmxremote
>> -Dcom.sun.management.jmxremote.port=8999
>> -Dcom.sun.management.jmxremote.ssl=false
>> -Dcom.sun.management.jmxremote.authenticate=false
>> -Djava.rmi.server.hostname=localhost"
>> export CATALINA_OPTS
>> Thats about the lease secure way you could setup JMX, but it gets the job
>> done for development.
>>
>
> AFAIK, JMX requires no configuration with JDK 1.6. After adding
> <jmxConfigurator/> into logback.xml, you just run jconsole. Does your
> experience differ?
>
> Otherwise, if running under JDK 1.5, the steps you describe look good.
>
Without that JConsole would never connect. After a little more research, it
looks like I had this problem because my `hostname` wasn't in /etc/hosts as
127.0.0.1. Once I fixed that I was able to connect without the
CATALINA_OPTS. Let that be a lesson: always make sure your hostname
resolves to 127.0.0.1 or weird stuff can break, like local JMX.
Nik Everett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090708/5b793b52/attachment.htm>
More information about the Logback-user
mailing list