Announcement Announcement Module
Collapse
No announcement yet.
Controlling log4j levels using Spring JMX Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Controlling log4j levels using Spring JMX

    Just saw this interesting post:
    http://www.jroller.com/page/klejs?entry=log4j_and_jmx

  • #2
    I had the same problem but I wanted a more complete solution - using the exporter it was a very straight forward move - publish the configuration through a simple wrapper bean and you could see the logger defined and their level.
    The problem was that the core classes for Log4j are not serializable so I had to come up with another alternatives like the one here. Ofc, one alternative would be to transport the log4j classes through some serializable objects but I didn't like the solution too much and I abandon it.
    Logging mania, I'm telling you

    Comment


    • #3
      Originally posted by costin
      I had the same problem but I wanted a more complete solution - using the exporter it was a very straight forward move - publish the configuration through a simple wrapper bean and you could see the logger defined and their level.
      The problem was that the core classes for Log4j are not serializable so I had to come up with another alternatives like the one here. Ofc, one alternative would be to transport the log4j classes through some serializable objects but I didn't like the solution too much and I abandon it.
      Logging mania, I'm telling you
      May be you can use scripts(beanshell or something) to change the logger's level on runtime.
      Define a wrapper bean of beanshell engine.
      Define a wrapper bean of log4j's root Category, and add it to the beanshell engine's namespace, It is easy to run "root.setLevel()" in a beanshell console.
      Indeed I have tried this. But I don't know if anyelse will be interested in it :lol:

      Comment

      Working...
      X