Skip to content

Commit

Permalink
Filter both shm and app insights warnings (#2814)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejizba authored Nov 6, 2021
1 parent c73450e commit d0775d4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,17 @@ private async Task<IWebHost> BuildWebHost(ScriptApplicationHostOptions hostOptio
// This is needed to filter system logs only for known categories
loggingBuilder.AddDefaultWebJobsFilters<ColoredConsoleLoggerProvider>(LogLevel.Trace);

// temporarily suppress shared memory warnings
loggingBuilder.AddFilter((category, logLevel) =>
{
// temporarily suppress shared memory warnings
var isSharedMemoryWarning = logLevel == LogLevel.Warning
&& string.Equals(category, "Microsoft.Azure.WebJobs.Script.Workers.SharedMemoryDataTransfer.MemoryMappedFileAccessor");
return !isSharedMemoryWarning;
});

// temporarily suppress AppInsights extension warnings
loggingBuilder.AddFilter((category, logLevel) =>
{
// temporarily suppress AppInsights extension warnings
var isAppInsightsExtensionWarning = logLevel == LogLevel.Warning
&& string.Equals(category, "Microsoft.Azure.WebJobs.Script.DependencyInjection.ScriptStartupTypeLocator");
return !isAppInsightsExtensionWarning;

return !isSharedMemoryWarning && !isAppInsightsExtensionWarning;
});
})
.ConfigureServices((context, services) =>
Expand Down

0 comments on commit d0775d4

Please sign in to comment.