APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.ssl

public final Class SSLLogger

extends Object
implements Logger
Class Inheritance
All Implemented Interfaces
java.lang.System.Logger
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, .PrintStream, java.nio.ByteBuffer, java.security.cert.Certificate, .Extension, .X509Certificate, java.text.MessageFormat, java.time.Instant, .ZoneId, java.time.format.DateTimeFormatter, java.util.*, jdk.internal.vm.annotation.ForceInline, sun.security.util.HexDumpEncoder, .Debug, sun.security.x509.*

Implementation of SSL logger.

If the system property "javax.net.debug" is not defined, the debug logging is turned off. If the system property "javax.net.debug" is defined as empty, the debug logger is specified by System.getLogger("javax.net.ssl"), and applications can customize and configure the logger or use external logging mechanisms. If the system property "javax.net.debug" is defined and non-empty, a private debug logger which logs to System.err is used.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
SSLLogger.Opt

Enum representing possible debug options for JSSE debugging.

private static class

Field Summary

Modifier and TypeField and Description
private static final System.Logger
private final String
private static final boolean
private final boolean

Constructor Summary

AccessConstructor and Description
private
SSLLogger(String loggerName, String options)

Method Summary

Modifier and TypeMethod and Description
public static void
fine(String msg, Object... params)

public static void
finer(String msg, Object... params)

public static void
finest(String msg, Object... params)

public String
getName()

Implements java.lang.System.Logger.getName.

Returns the name of this logger.

private static void
help()

public static void
info(String msg, Object... params)

public boolean
isLoggable(System.Logger.Level level)

Implements java.lang.System.Logger.isLoggable.

Checks if a message of the given level would be logged by this logger.

public static boolean
isOn()

public static boolean
isOn(SSLLogger.Opt option)

Return true if the specific DebugOption is enabled or ALL is enabled

public void
log(System.Logger.Level level, ResourceBundle rb, String message, Throwable thrwbl)

Implements java.lang.System.Logger.log.

Logs a localized message associated with a given throwable.

public void
log(System.Logger.Level level, ResourceBundle rb, String message, Object... params)

Implements java.lang.System.Logger.log.

Logs a message with resource bundle and an optional list of parameters.

private static void
log0(System.Logger.Level level, String msg, Object... params)

pack-priv static boolean
public static void
severe(String msg, Object... params)

pack-priv static String
toString(Object... params)

public static void
warning(String msg, Object... params)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
private static final System.Logger logger
loggerNameback to summary
private final String loggerName
loggingback to summary
private static final boolean logging
useCompactFormatback to summary
private final boolean useCompactFormat

Constructor Detail

SSLLoggerback to summary
private SSLLogger(String loggerName, String options)

Method Detail

fineback to summary
public static void fine(String msg, Object... params)
finerback to summary
public static void finer(String msg, Object... params)
finestback to summary
public static void finest(String msg, Object... params)
getNameback to summary
public String getName()

Implements java.lang.System.Logger.getName.

Doc from java.lang.System.Logger.getName.

Returns the name of this logger.

Annotations
@Override
helpback to summary
private static void help()
infoback to summary
public static void info(String msg, Object... params)
isLoggableback to summary
public boolean isLoggable(System.Logger.Level level)

Implements java.lang.System.Logger.isLoggable.

Doc from java.lang.System.Logger.isLoggable.

Checks if a message of the given level would be logged by this logger.

Annotations
@Override
isOnback to summary
public static boolean isOn()
Annotations
@ForceInline
isOnback to summary
public static boolean isOn(SSLLogger.Opt option)

Return true if the specific DebugOption is enabled or ALL is enabled

logback to summary
public void log(System.Logger.Level level, ResourceBundle rb, String message, Throwable thrwbl)

Implements java.lang.System.Logger.log.

Doc from java.lang.System.Logger.log.

Logs a localized message associated with a given throwable. If the given resource bundle is non-null, the msg string is localized using the given resource bundle. Otherwise the msg string is not localized.

Annotations
@Override
logback to summary
public void log(System.Logger.Level level, ResourceBundle rb, String message, Object... params)

Implements java.lang.System.Logger.log.

Doc from java.lang.System.Logger.log.

Logs a message with resource bundle and an optional list of parameters. If the given resource bundle is non-null, the format string is localized using the given resource bundle. Otherwise the format string is not localized.

Annotations
@Override
log0back to summary
private static void log0(System.Logger.Level level, String msg, Object... params)
logWarningback to summary
pack-priv static boolean logWarning(SSLLogger.Opt option, String s)
severeback to summary
public static void severe(String msg, Object... params)
toStringback to summary
pack-priv static String toString(Object... params)
warningback to summary
public static void warning(String msg, Object... params)
sun.security.ssl back to summary

public final Enum SSLLogger.Opt

extends Enum<SSLLogger.Opt>
Class Inheritance

Enum representing possible debug options for JSSE debugging.

ALL and SSL are considered master components. Entries without an underscore ("_"), and not ALL or SSL, are subcomponents. Entries with an underscore ("_") denote options specific to subcomponents.

Fields: - 'component': Lowercase name of the option. - 'isSubComponent': True for subcomponents. - 'on': Indicates whether the option is enabled. Some rule based logic is used to determine value of this field.

Enabling subcomponents fine-tunes (filters) debug output.

Field Summary

Modifier and TypeField and Description
public static final SSLLogger.Opt
pack-priv final String
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
pack-priv final boolean
public static final SSLLogger.Opt
pack-priv boolean
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt
public static final SSLLogger.Opt

Constructor Summary

AccessConstructor and Description
private
Opt()

Method Summary

Modifier and TypeMethod and Description
public static SSLLogger.Opt
public static SSLLogger.Opt[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final SSLLogger.Opt ALL
componentback to summary
pack-priv final String component
DEFAULTCTXback to summary
public static final SSLLogger.Opt DEFAULTCTX
HANDSHAKEback to summary
public static final SSLLogger.Opt HANDSHAKE
HANDSHAKE_VERBOSEback to summary
public static final SSLLogger.Opt HANDSHAKE_VERBOSE
isSubComponentback to summary
pack-priv final boolean isSubComponent
KEYMANAGERback to summary
public static final SSLLogger.Opt KEYMANAGER
onback to summary
pack-priv boolean on
RECORDback to summary
public static final SSLLogger.Opt RECORD
RECORD_PACKETback to summary
public static final SSLLogger.Opt RECORD_PACKET
RECORD_PLAINTEXTback to summary
public static final SSLLogger.Opt RECORD_PLAINTEXT
RESPMGRback to summary
public static final SSLLogger.Opt RESPMGR
SESSIONback to summary
public static final SSLLogger.Opt SESSION
SESSIONCACHEback to summary
public static final SSLLogger.Opt SESSIONCACHE
SSLback to summary
public static final SSLLogger.Opt SSL
SSLCTXback to summary
public static final SSLLogger.Opt SSLCTX
TRUSTMANAGERback to summary
public static final SSLLogger.Opt TRUSTMANAGER

Constructor Detail

Optback to summary
private Opt()

Method Detail

valueOfback to summary
public static SSLLogger.Opt valueOf(String name)
valuesback to summary
public static SSLLogger.Opt[] values()
sun.security.ssl back to summary

private Class SSLLogger.SSLSimpleFormatter

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final MessageFormat
private static final DateTimeFormatter
private static final MessageFormat
private static final MessageFormat
private static final MessageFormat
private static final MessageFormat
private static final MessageFormat
private static final MessageFormat
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
format(SSLLogger logger, System.Logger.Level level, String message, Object... parameters)

private static String
private static String
private static String
private static String
private static String
private static String
private static String
formatParameters(Object... parameters)

private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

basicCertFormatback to summary
private static final MessageFormat basicCertFormat
dateTimeFormatback to summary
private static final DateTimeFormatter dateTimeFormat
extendedCertFormatback to summary
private static final MessageFormat extendedCertFormat
keyObjectFormatback to summary
private static final MessageFormat keyObjectFormat
messageCompactFormatNoParasback to summary
private static final MessageFormat messageCompactFormatNoParas
messageCompactFormatWithParasback to summary
private static final MessageFormat messageCompactFormatWithParas
messageFormatNoParasback to summary
private static final MessageFormat messageFormatNoParas
messageFormatWithParasback to summary
private static final MessageFormat messageFormatWithParas
PATTERNback to summary
private static final String PATTERN

Constructor Detail

SSLSimpleFormatterback to summary
private SSLSimpleFormatter()

Method Detail

formatback to summary
private static String format(SSLLogger logger, System.Logger.Level level, String message, Object... parameters)
formatByteArrayInputStreamback to summary
private static String formatByteArrayInputStream(ByteArrayInputStream bytes)
formatByteBufferback to summary
private static String formatByteBuffer(ByteBuffer byteBuffer)
formatCallerback to summary
private static String formatCaller()
formatCertificateback to summary
private static String formatCertificate(Certificate certificate)
formatMapEntryback to summary
private static String formatMapEntry(Map.Entry<String, ?> entry)
formatObjectback to summary
private static String formatObject(Object obj)
formatParametersback to summary
private static String formatParameters(Object... parameters)
formatThrowableback to summary
private static String formatThrowable(Throwable throwable)