RFR: 8372004: Have SSLLogger implement System.Logger

Mikhail Yankelevich myankelevich at openjdk.org
Tue Nov 18 16:02:51 UTC 2025


On Tue, 18 Nov 2025 15:50:42 GMT, Sean Coffey <coffeys at openjdk.org> wrote:

> `SSLLogger` utilizes `System.Logger` if the `javax.net.debug` system property key value is empty. However, since that class doesn't implement `SSLogger`, it misses the advantage of highlighting the exact calling site for each log statement.  Having `SSLLogger `simply implement `System.Logger` fixes this
> 
> I've also taken this opportunity to refractor the `isOn` boolean in `SSLLogger`. Encapsulated that boolean in a new method which callers can now use. I also used `ForceInline` directory on that method. Thanks to @dfuch for suggestions on that front.
> 
> Also updated an existing unit testcase to test for the new functionality

Also, copyrights 😃

src/java.base/share/classes/sun/security/ssl/Alert.java line 241:

> 239: 
> 240:             AlertMessage am = new AlertMessage(tc, m);
> 241:             if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) {

Would it make sense to add the calls to the helper methods introduced here [JDK-8371721](https://bugs.openjdk.org/browse/JDK-8371721)? I know this is not merged yet, but seems like changing it now and later changing it to be another method might not be the most efficient way. At least this is how it looks to me. 

What do you think?

-------------

PR Review: https://git.openjdk.org/jdk/pull/28376#pullrequestreview-3478535953
PR Review Comment: https://git.openjdk.org/jdk/pull/28376#discussion_r2538757474


More information about the security-dev mailing list