Skip to content

Commit 809e3d8

Browse files
Hean ChhinlingHean Chhinling
authored andcommitted
HadoopYARN-11726: Add logging statements for successful and unsucessful password retrieval operations
1 parent 9ae01bd commit 809e3d8

File tree

1 file changed

+5
-0
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util

1 file changed

+5
-0
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
import org.apache.hadoop.yarn.webapp.NotFoundException;
4848
import org.apache.http.NameValuePair;
4949
import org.apache.http.client.utils.URLEncodedUtils;
50+
import org.slf4j.Logger;
51+
import org.slf4j.LoggerFactory;
5052

5153
import javax.servlet.http.HttpServletRequest;
5254

@@ -61,6 +63,7 @@ public class WebAppUtils {
6163
"ssl.server.keystore.keypassword";
6264
public static final String HTTPS_PREFIX = "https://";
6365
public static final String HTTP_PREFIX = "http://";
66+
public static final Logger LOG = LoggerFactory.getLogger(WebAppUtils.class);
6467

6568
public static void setRMWebAppPort(Configuration conf, int port) {
6669
String hostname = getRMWebAppURLWithoutScheme(conf);
@@ -509,10 +512,12 @@ static String getPassword(Configuration conf, String alias) {
509512
char[] passchars = conf.getPassword(alias);
510513
if (passchars != null) {
511514
password = new String(passchars);
515+
LOG.debug("Successful password retrieval for alias: {}", alias);
512516
}
513517
}
514518
catch (IOException ioe) {
515519
password = null;
520+
LOG.error("Unable to retrieve password for alias: {}", alias, ioe);
516521
}
517522
return password;
518523
}

0 commit comments

Comments
 (0)