Skip to content

Commit d0775d4

Browse files
authored
Filter both shm and app insights warnings (#2814)
1 parent c73450e commit d0775d4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs

+4-7
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,17 @@ private async Task<IWebHost> BuildWebHost(ScriptApplicationHostOptions hostOptio
225225
// This is needed to filter system logs only for known categories
226226
loggingBuilder.AddDefaultWebJobsFilters<ColoredConsoleLoggerProvider>(LogLevel.Trace);
227227

228-
// temporarily suppress shared memory warnings
229228
loggingBuilder.AddFilter((category, logLevel) =>
230229
{
230+
// temporarily suppress shared memory warnings
231231
var isSharedMemoryWarning = logLevel == LogLevel.Warning
232232
&& string.Equals(category, "Microsoft.Azure.WebJobs.Script.Workers.SharedMemoryDataTransfer.MemoryMappedFileAccessor");
233-
return !isSharedMemoryWarning;
234-
});
235233

236-
// temporarily suppress AppInsights extension warnings
237-
loggingBuilder.AddFilter((category, logLevel) =>
238-
{
234+
// temporarily suppress AppInsights extension warnings
239235
var isAppInsightsExtensionWarning = logLevel == LogLevel.Warning
240236
&& string.Equals(category, "Microsoft.Azure.WebJobs.Script.DependencyInjection.ScriptStartupTypeLocator");
241-
return !isAppInsightsExtensionWarning;
237+
238+
return !isSharedMemoryWarning && !isAppInsightsExtensionWarning;
242239
});
243240
})
244241
.ConfigureServices((context, services) =>

0 commit comments

Comments
 (0)