Skip to content

Commit 6995bc7

Browse files
#1955378: [Test] NPE when start streaming log for an un-deployed function app
1 parent 55d889d commit 6995bc7

File tree

1 file changed

+3
-1
lines changed
  • PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.appservice/src/com/microsoft/azure/toolkit/eclipse/functionapp/logstreaming

1 file changed

+3
-1
lines changed

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.appservice/src/com/microsoft/azure/toolkit/eclipse/functionapp/logstreaming/FunctionAppLogStreamingHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.io.IOException;
99
import java.io.UnsupportedEncodingException;
1010
import java.net.URLEncoder;
11+
import java.util.Optional;
1112

1213
import org.apache.commons.lang3.StringUtils;
1314

@@ -97,7 +98,8 @@ private static String getApplicationInsightLiveMetricsUrl(ApplicationInsight tar
9798
}
9899

99100
private static boolean isLogStreamingEnabled(FunctionAppBase<?, ?, ?> functionApp) {
100-
return functionApp.getRuntime().getOperatingSystem() == OperatingSystem.LINUX || functionApp.getDiagnosticConfig().isEnableApplicationLog();
101+
return functionApp.getRuntime().getOperatingSystem() == OperatingSystem.LINUX ||
102+
Optional.ofNullable(functionApp.getDiagnosticConfig()).map(DiagnosticConfig::isEnableWebServerLogging).orElse(false);
101103
}
102104

103105
private static void enableLogStreaming(FunctionAppBase<?, ?, ?> functionApp) {

0 commit comments

Comments
 (0)