HADOOP-16174. Disable wildfly logs to the console.

Follow-on to HADOOP-15851.

Author:    Denes Gerencser <dgerencser@cloudera.com>
This commit is contained in:
Denes Gerencser 2019-03-09 18:45:17 +00:00 committed by Steve Loughran
parent bb8ad096e7
commit ddede7ae6f
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 4 additions and 1 deletions

View File

@ -120,9 +120,12 @@ public final class SSLSocketFactoryEx extends SSLSocketFactory {
switch (preferredChannelMode) {
case Default:
try {
java.util.logging.Logger.getLogger(SSL.class.getName()).setLevel(Level.WARNING);
java.util.logging.Logger logger = java.util.logging.Logger.getLogger(SSL.class.getName());
logger.setLevel(Level.WARNING);
ctx = SSLContext.getInstance("openssl.TLS");
ctx.init(null, null, null);
// Strong reference needs to be kept to logger until initialization of SSLContext finished (see HADOOP-16174):
logger.setLevel(Level.INFO);
channelMode = SSLChannelMode.OpenSSL;
} catch (NoSuchAlgorithmException e) {
LOG.warn("Failed to load OpenSSL. Falling back to the JSSE default.");