My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links
  • External links
  • Demo

Short description

JMX bean which provides the functionality to change the log level of a class/package and to reload the log4j.properties during runtime.

Introduction

I was facing the problem to change log4j.properties settings of classes/categories during runtime of an application. Additionally i wanted to have also the possibility to reset/reload the settings again like they was before. After studying log4j documentation i couldn't find only a half solution materialized as an jmx bean (http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/jmx/package-summary.html). After deeper google search for this issue, i found several hints how to solve this issue, which i would like to combine here.

Details

Requirements

Functionality

All functionalities are grouped in the interface http://code.google.com/p/logging-jmx-service/source/browse/trunk/logjmxservice/src/main/java/de/stefanheintz/log/jmxservice/LoggingConfig.java of the JMX MBean http://code.google.com/p/logging-jmx-service/source/browse/trunk/logjmxservice/src/main/java/de/stefanheintz/log/jmxservice/LoggingConfigImpl.java:

  • setting of TRACE, DEBUG, INFO, WARN, ERROR, FATAL log levels for a class or category
  • disabling of logging of a class or category
  • show runtime log4j settings
  • reload the log4j.properties settings from classpath

Short demonstration:

More details are available at the Tutorial page.

Version history

Version Date Descritpion
1.1.12009-05-10Small NPE bug fixing for changing log level of a class having no log level yet
1.1.02009-02-10Sending notifications whenever a log level change or reloading was triggered
1.0.02009-01-04First implementation including setting of log levels and reloading of the log4j.properties

References

Powered by Google Project Hosting