Skip to content

Commit

Permalink
updating category prefixes (Azure#6589)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettsam authored Sep 2, 2020
1 parent 7d9cd7f commit c82943c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/WebJobs.Script/Extensions/ScriptLoggingBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Linq;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Azure.WebJobs.Script;
using Microsoft.Azure.WebJobs.Script.Configuration;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
Expand All @@ -11,14 +12,6 @@ namespace Microsoft.Extensions.Logging
{
public static class ScriptLoggingBuilderExtensions
{
internal static readonly string[] AllowedCategoryPrefixes = new[]
{
"Microsoft.Azure.WebJobs",
"Function",
"Worker",
"Host"
};

public static void AddDefaultWebJobsFilters(this ILoggingBuilder builder)
{
builder.SetMinimumLevel(LogLevel.None);
Expand All @@ -33,7 +26,7 @@ public static void AddDefaultWebJobsFilters<T>(this ILoggingBuilder builder, Log

private static bool Filter(string category, LogLevel actualLevel, LogLevel minLevel)
{
return actualLevel >= minLevel && AllowedCategoryPrefixes.Where(p => category.StartsWith(p)).Any();
return actualLevel >= minLevel && ScriptConstants.SystemLogCategoryPrefixes.Where(p => category.StartsWith(p)).Any();
}

public static void AddConsoleIfEnabled(this ILoggingBuilder builder, HostBuilderContext context)
Expand Down
2 changes: 2 additions & 0 deletions src/WebJobs.Script/ScriptConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,7 @@ public static class ScriptConstants
public static readonly ImmutableArray<string> AssemblyFileTypes = ImmutableArray.Create(".dll", ".exe");
public static readonly string HostUserAgent = $"azure-functions-host/{ScriptHost.Version}";
public static readonly NuGetVersion ExtensionBundleVersionTwo = new NuGetVersion("2.0.0");

public static readonly ImmutableArray<string> SystemLogCategoryPrefixes = ImmutableArray.Create("Microsoft.Azure.WebJobs.", "Function.", "Worker.", "Host.");
}
}

0 comments on commit c82943c

Please sign in to comment.