Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

odrotbohm/spring-jmx-namespace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small JMX namespace to allow setting up logger JMX beans with Spring
--------------------------------------------------------------------

This library allows exposing loggers to JMX to alter the log level at
runtime for example. Currently it supports Log4J as well as Logback as 
actual logging runtime only but I am open to add other ones if there's 
demand.

To get an impression of how you can use the library take a look at
jmx-logger.xml in the test tree. There you can find a logger like this:

<jmx:logger type="Log4J" name="org.springframework" />

Combined with the <context:mbean-server /> this will register the logger 
for org.springframework as JMX MBean. Furthermore you can trigger 
auto-detection of loggers by defining a logger element like so:

<jmx:logger type="Log4J" name="org.springframework" levels="2" />

This would register JMX MBeans for loggers two package levels below 
org.springframework if existing. To see it working live simply run the 
Sample class, and open a JConsole or the like, find the LoggerDynamicMBean 
and alter the log level to DEBUG. Pressing Enter in the console should 
give you a sample DEBUG level message then.

About

JMX utility Spring namespace

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages