RFR: 8372004: Have SSLLogger implement System.Logger
Daniel Fuchs
dfuchs at openjdk.org
Tue Nov 18 16:19:07 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
Good to see `isOn` is now encapsulated. The mechanical changes `isOn` -> `isOn()` all look OK - I haven't spotted anything there. A few comments to SSLLogger. I don't understand the changes to the DebugPropertyValuesTest.
src/java.base/share/classes/sun/security/ssl/SSLLogger.java line 146:
> 144:
> 145: public static void severe(String msg, Object... params) {
> 146: SSLLogger.doLog(Level.ERROR, msg, params);
`log0` might be a better name than `doLog`
src/java.base/share/classes/sun/security/ssl/SSLLogger.java line 190:
> 188: }
> 189:
> 190: private static void help() {
Keeping the help method at ~ the same place in the file would make it easier to review. Was there any change in this method?
test/jdk/sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java line 94:
> 92: + System.lineSeparator() +
> 93: " \"certificate\" : \\{",
> 94: "sun.security.ssl.SSLSocketImpl close",
was that change intended? I don't see what it has to do with the rest.
-------------
PR Review: https://git.openjdk.org/jdk/pull/28376#pullrequestreview-3478576147
PR Review Comment: https://git.openjdk.org/jdk/pull/28376#discussion_r2538789696
PR Review Comment: https://git.openjdk.org/jdk/pull/28376#discussion_r2538795357
PR Review Comment: https://git.openjdk.org/jdk/pull/28376#discussion_r2538818340
More information about the security-dev
mailing list