-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #4830 - Enabling JMX on jetty-slf4j-impl #4839
Issue #4830 - Enabling JMX on jetty-slf4j-impl #4839
Conversation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
…4830-jetty-slf4j-impl-with-jmx
Alternative implementation that adds JMX support for jetty-slf4j-impl. This version modifies MBeanContainer to be aware of @mxbean annotations and *MBean and *MXBean interfaces, so it does not require a dependency on jetty-jmx nor on java.management. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has elements that are better, and elements that need better testing.
@@ -526,7 +526,7 @@ public void testToString() | |||
assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=ERROR")); | |||
|
|||
log.setLevel(JettyLogger.OFF); | |||
assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=OFF")); | |||
assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=ERROR")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What?
OFF != ERROR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #4831, "OFF" is converted to 999 and 999 is converted to Level.ERROR. So, uhm, why don't we get rid of OFF and just call it ERROR so it conforms to SLF4J?
jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/LevelUtils.java
Outdated
Show resolved
Hide resolved
jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JMXTest.java
Outdated
Show resolved
Hide resolved
jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java
Show resolved
Hide resolved
Updates after review. Fixed test failures. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet mind if I add a few more unit tests to this branch? |
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
…l names Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Updates after review. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Updates after review, take 2. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@sbordet any reason this has not been merged? |
@joakime can you please review and compare this alternative implementation?