66package com .microsoft .azuretools .authmanage ;
77
88import com .azure .core .implementation .http .HttpClientProviders ;
9+ import com .microsoft .aad .msal4j .PublicClientApplication ;
910import com .microsoft .azure .management .Azure ;
1011import com .microsoft .azure .management .appplatform .v2020_07_01 .implementation .AppPlatformManager ;
1112import com .microsoft .azure .management .mysql .v2020_01_01 .implementation .MySQLManager ;
2829import com .microsoft .azuretools .telemetrywrapper .EventUtil ;
2930import com .microsoft .azuretools .utils .AzureUIRefreshCore ;
3031import com .microsoft .azuretools .utils .AzureUIRefreshEvent ;
31- import reactor .core .publisher .Mono ;
32- import reactor .core .scheduler .Schedulers ;
32+
33+ import org .apache .log4j .Level ;
34+ import org .apache .log4j .Logger ;
3335
3436import java .io .IOException ;
3537import java .nio .charset .StandardCharsets ;
4042import java .util .Set ;
4143import java .util .concurrent .CompletableFuture ;
4244import java .util .concurrent .ExecutionException ;
43- import java .util .logging .Logger ;
4445import java .util .stream .Collectors ;
4546
4647import static com .microsoft .azuretools .Constants .FILE_NAME_AUTH_METHOD_DETAILS ;
47- import static com .microsoft .azuretools .telemetry .TelemetryConstants .*;
48+ import static com .microsoft .azuretools .telemetry .TelemetryConstants .ACCOUNT ;
49+ import static com .microsoft .azuretools .telemetry .TelemetryConstants .AZURE_ENVIRONMENT ;
50+ import static com .microsoft .azuretools .telemetry .TelemetryConstants .RESIGNIN ;
51+ import static com .microsoft .azuretools .telemetry .TelemetryConstants .SIGNIN_METHOD ;
52+
53+ import reactor .core .publisher .Hooks ;
54+ import reactor .core .publisher .Mono ;
55+ import reactor .core .scheduler .Schedulers ;
4856
4957public class AuthMethodManager {
50- private static final Logger LOGGER = Logger .getLogger (AuthMethodManager .class .getName ());
58+ private static final org .apache .log4j .Logger LOGGER =
59+ org .apache .log4j .Logger .getLogger (PublicClientApplication .class );
5160 private AuthMethodDetails authMethodDetails ;
5261 private final Set <Runnable > signInEventListeners = new HashSet <>();
5362 private final Set <Runnable > signOutEventListeners = new HashSet <>();
@@ -57,6 +66,7 @@ public class AuthMethodManager {
5766 static {
5867 // fix the class load problem for intellij plugin
5968 ClassLoader current = Thread .currentThread ().getContextClassLoader ();
69+ Logger .getLogger (com .microsoft .aad .adal4j .AuthenticationContext .class ).setLevel (Level .OFF );
6070 try {
6171 Thread .currentThread ().setContextClassLoader (AuthMethodManager .class .getClassLoader ());
6272 HttpClientProviders .createInstance ();
@@ -83,7 +93,7 @@ private AuthMethodManager() {
8393 try {
8494 initAuthMethodManagerFromSettings ();
8595 } catch (Throwable ex ) {
86- LOGGER .warning ("Cannot restore login due to error: " + ex .getMessage ());
96+ LOGGER .warn ("Cannot restore login due to error: " + ex .getMessage ());
8797 }
8898 return true ;
8999 }).subscribeOn (Schedulers .boundedElastic ()).subscribe ();
@@ -255,7 +265,7 @@ private void initAuthMethodManagerFromSettings() {
255265 }
256266 case AD :
257267 // we don't support it now
258- LOGGER .warning ("The AD auth method is not supported now, ignore the credential." );
268+ LOGGER .warn ("The AD auth method is not supported now, ignore the credential." );
259269 break ;
260270 case SP :
261271 targetAuthMethodDetails .setAuthType (AuthType .SERVICE_PRINCIPAL );
0 commit comments