Skip to content

Commit c82943c

Browse files
authored
updating category prefixes (#6589)
1 parent 7d9cd7f commit c82943c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/WebJobs.Script/Extensions/ScriptLoggingBuilderExtensions.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Linq;
55
using Microsoft.AspNetCore.Hosting;
6+
using Microsoft.Azure.WebJobs.Script;
67
using Microsoft.Azure.WebJobs.Script.Configuration;
78
using Microsoft.Extensions.Configuration;
89
using Microsoft.Extensions.Hosting;
@@ -11,14 +12,6 @@ namespace Microsoft.Extensions.Logging
1112
{
1213
public static class ScriptLoggingBuilderExtensions
1314
{
14-
internal static readonly string[] AllowedCategoryPrefixes = new[]
15-
{
16-
"Microsoft.Azure.WebJobs",
17-
"Function",
18-
"Worker",
19-
"Host"
20-
};
21-
2215
public static void AddDefaultWebJobsFilters(this ILoggingBuilder builder)
2316
{
2417
builder.SetMinimumLevel(LogLevel.None);
@@ -33,7 +26,7 @@ public static void AddDefaultWebJobsFilters<T>(this ILoggingBuilder builder, Log
3326

3427
private static bool Filter(string category, LogLevel actualLevel, LogLevel minLevel)
3528
{
36-
return actualLevel >= minLevel && AllowedCategoryPrefixes.Where(p => category.StartsWith(p)).Any();
29+
return actualLevel >= minLevel && ScriptConstants.SystemLogCategoryPrefixes.Where(p => category.StartsWith(p)).Any();
3730
}
3831

3932
public static void AddConsoleIfEnabled(this ILoggingBuilder builder, HostBuilderContext context)

src/WebJobs.Script/ScriptConstants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,7 @@ public static class ScriptConstants
175175
public static readonly ImmutableArray<string> AssemblyFileTypes = ImmutableArray.Create(".dll", ".exe");
176176
public static readonly string HostUserAgent = $"azure-functions-host/{ScriptHost.Version}";
177177
public static readonly NuGetVersion ExtensionBundleVersionTwo = new NuGetVersion("2.0.0");
178+
179+
public static readonly ImmutableArray<string> SystemLogCategoryPrefixes = ImmutableArray.Create("Microsoft.Azure.WebJobs.", "Function.", "Worker.", "Host.");
178180
}
179181
}

0 commit comments

Comments
 (0)