@@ -145,6 +145,9 @@ private final GoogleCredentials getDefaultCredentialsUnsynchronized(
145145 GoogleCredentials credentials = null ;
146146 String credentialsPath = getEnv (CREDENTIAL_ENV_VAR );
147147 if (credentialsPath != null && credentialsPath .length () > 0 ) {
148+ LOGGER .log (
149+ Level .FINE ,
150+ String .format ("Attempting to load credentials from file: %s" , credentialsPath ));
148151 InputStream credentialsStream = null ;
149152 try {
150153 File credentialsFile = new File (credentialsPath );
@@ -178,6 +181,11 @@ private final GoogleCredentials getDefaultCredentialsUnsynchronized(
178181 InputStream credentialsStream = null ;
179182 try {
180183 if (isFile (wellKnownFileLocation )) {
184+ LOGGER .log (
185+ Level .FINE ,
186+ String .format (
187+ "Attempting to load credentials from well known file: %s" ,
188+ wellKnownFileLocation .getCanonicalPath ()));
181189 credentialsStream = readStream (wellKnownFileLocation );
182190 credentials = GoogleCredentials .fromStream (credentialsStream , transportFactory );
183191 }
@@ -198,17 +206,20 @@ private final GoogleCredentials getDefaultCredentialsUnsynchronized(
198206
199207 // Then try GAE 7 standard environment
200208 if (credentials == null && isOnGAEStandard7 () && !skipAppEngineCredentialsCheck ()) {
209+ LOGGER .log (Level .FINE , "Attempting to load credentials from GAE 7 Standard" );
201210 credentials = tryGetAppEngineCredential ();
202211 }
203212
204213 // Then try Cloud Shell. This must be done BEFORE checking
205214 // Compute Engine, as Cloud Shell runs on GCE VMs.
206215 if (credentials == null ) {
216+ LOGGER .log (Level .FINE , "Attempting to load credentials from Cloud Shell" );
207217 credentials = tryGetCloudShellCredentials ();
208218 }
209219
210220 // Then try Compute Engine and GAE 8 standard environment
211221 if (credentials == null ) {
222+ LOGGER .log (Level .FINE , "Attempting to load credentials from GCE" );
212223 credentials = tryGetComputeCredentials (transportFactory );
213224 }
214225
0 commit comments