-
Notifications
You must be signed in to change notification settings - Fork 1
io microsphere logging jmx LoggingMXBeanAdapter
Type: Class | Module: microsphere-logging-commons | Package: io.microsphere.logging.jmx | Since: 1.0.0
Source:
microsphere-logging-commons/src/main/java/io/microsphere/logging/jmx/LoggingMXBeanAdapter.java
LoggingMXBean Adapter based on the Logging delegate.
public class LoggingMXBeanAdapter implements LoggingMXBean, DelegatingWrapperAuthor: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.1.14-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 8 | ✅ Compatible |
| Java 11 | ✅ Compatible |
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
List<String> names = adapter.getLoggerNames();Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
String level = adapter.getLoggerLevel("io.microsphere");Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
adapter.setLoggerLevel("io.microsphere", "DEBUG");Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
String parentName = adapter.getParentLoggerName("io.microsphere.logging");
// returns "io.microsphere"Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
Logging delegate = (Logging) adapter.getDelegate();Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-logging-commons</artifactId>
<version>${microsphere-logging.version}</version>
</dependency>Tip: Use the BOM (
microsphere-logging-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.logging.jmx.LoggingMXBeanAdapter;| Method | Description |
|---|---|
getLoggerNames |
Creates a new LoggingMXBeanAdapter wrapping the given Logging instance. |
getLoggerLevel |
{@inheritDoc} |
setLoggerLevel |
{@inheritDoc} |
getParentLoggerName |
{@inheritDoc} |
getDelegate |
Returns the underlying Logging delegate. |
public List<String> getLoggerNames()Creates a new LoggingMXBeanAdapter wrapping the given Logging instance.
`Logging logging = LoggingUtils.load(); LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging); `
public String getLoggerLevel(String loggerName){@inheritDoc}
`Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
String level = adapter.getLoggerLevel("io.microsphere");
`
public void setLoggerLevel(String loggerName, String levelName){@inheritDoc}
`Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
adapter.setLoggerLevel("io.microsphere", "DEBUG");
`
public String getParentLoggerName(String loggerName){@inheritDoc}
`Logging logging = LoggingUtils.load();
LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging);
String parentName = adapter.getParentLoggerName("io.microsphere.logging");
// returns "io.microsphere"
`
public Object getDelegate()Returns the underlying Logging delegate.
`Logging logging = LoggingUtils.load(); LoggingMXBeanAdapter adapter = new LoggingMXBeanAdapter(logging); Logging delegate = (Logging) adapter.getDelegate(); `
LoggingMXBeanLogging
This documentation was auto-generated from the source code of microsphere-logging.
java-logging
log4j
log4j2
- DelegatingLayout
- InMemoryAppender
- Log4j2Logger
- Log4j2LoggerFactory
- Log4j2Logging
- Log4j2Utils
- LogEventComparator
- SmartFileAppenderLayout
logback
logging-commons
- DefaultLoggingLevelsResolver
- Logging
- LoggingLevelsResolver
- LoggingMXBeanAdapter
- LoggingMXBeanRegistrar
- LoggingUtils
logging-examples
logging-test