Last active
March 6, 2017 20:09
-
-
Save BrennanConroy/fc3210dbf59a10f5c4ee34df9706e682 to your computer and use it in GitHub Desktop.
Logging Config + Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Logging": { | |
"Default": { | |
"LogLevel": { | |
"Microsoft.AspNetCore": "Critical", | |
"System": "Warning" | |
} | |
}, | |
"DebugLogger": { // do these override "Default" section above? | |
"LogLevel": { | |
"System": "Information", | |
"Microsoft": "Warning" | |
} | |
}, | |
"ConsoleLogger": { | |
"SomeName": { | |
"LogLevel": { | |
"System": "Critical" | |
} | |
}, | |
"LogLevel": { | |
"Microsoft": "Error" | |
} | |
}, | |
"TraceSourceLogger": { | |
"LogLevel": { | |
"System": "Error", | |
"WebApplication2.MyApp": "Trace" | |
} | |
}, | |
"SomeName": { | |
"LogLevel": { | |
"System": "Critical" | |
} | |
} | |
} | |
} | |
API Changes: | |
- public interface ILoggerFactory -> Add "void AddProvider(ILoggerProvider provider, string providerName)" | |
- public interface ILoggerFactory -> Add "void AddFilter(Func<string, LogLevel, bool> filter)" | |
- public interface ILoggerFactory -> Add "void AddFilter(IConfiguration configuration)" | |
- public static ILoggerFactory AddConsole(this ILoggerFactory factory, IConfiguration configuration) -> obsolete | |
- obsolete all of "Microsoft.AspNetCore.Logging.Filter" | |
Q: AddConsole and AdddDebug have "Func<string, LogLevel, bool> filter" overloads, should other loggers have this? Like AddEventLog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment