Results 1 to 3 of 3

Thread: Controlling log4j levels using Spring JMX

  1. #1
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default Controlling log4j levels using Spring JMX


  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Oct 2005
    Posts
    29

    Default

    Quote 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:

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Controlling log4j using Spring JMX and jmanage
    By kbaum in forum Management
    Replies: 13
    Last Post: Oct 14th, 2006, 09:13 AM
  3. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Stop Spring Logging
    By jgchristopher in forum Container
    Replies: 6
    Last Post: Dec 8th, 2004, 10:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •