RFR: 8372004: Have SSLLogger implement System.Logger

Daniel Fuchs dfuchs at openjdk.org
Tue Nov 18 16:23:07 UTC 2025


On Tue, 18 Nov 2025 16:04:11 GMT, Daniel Fuchs <dfuchs 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
>
> 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`

Since you have now imported `@ForceInline` maybe you could also add it to `doLog` - the methods that call it are all one-liners.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28376#discussion_r2538847240


More information about the security-dev mailing list