public static ILoggerFactory AddCloudFoundry( this ILoggerFactory factory, Func <string, LogLevel, bool> filter) { factory.AddCloudFoundry(filter, includeScopes: false); return(factory); }
public Startup(ILoggerFactory loggerFactory) { var appsettings = @" { 'Logging': { 'IncludeScopes': false, 'LogLevel': { 'Default': 'Warning', 'Pivotal': 'Information', 'Steeltoe': 'Information' } }, 'management': { 'endpoints': { 'enabled': true, 'sensitive': false, 'path': '/cloudfoundryapplication', 'trace' : { 'enabled': true, 'sensitive': false } } } }"; var path = TestHelpers.CreateTempFile(appsettings); string directory = Path.GetDirectoryName(path); string fileName = Path.GetFileName(path); ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.SetBasePath(directory); configurationBuilder.AddJsonFile(fileName); Configuration = configurationBuilder.Build(); loggerFactory.AddCloudFoundry(Configuration.GetSection("Logging")); }
public static ILoggerFactory AddCloudFoundry( this ILoggerFactory factory, LogLevel minLevel, bool includeScopes) { factory.AddCloudFoundry((category, logLevel) => logLevel >= minLevel, includeScopes); return(factory); }
public Startup(IHostingEnvironment env, ILoggerFactory loggerFactory) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables() .AddConfigServer(env, loggerFactory); Configuration = builder.Build(); loggerFactory.AddCloudFoundry(Configuration.GetSection("Logging")); }
protected virtual void AddLoggingProviders(ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); loggerFactory.AddCloudFoundry(Configuration.GetSection("Logging")); }
public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory, IConfiguration configuration) { var settings = new CloudFoundryLoggerSettings(configuration); return(factory.AddCloudFoundry(settings)); }
public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory, LogLevel minLevel) { factory.AddCloudFoundry(minLevel, includeScopes: false); return(factory); }
public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory, bool includeScopes) { factory.AddCloudFoundry((n, l) => l >= LogLevel.Information, includeScopes); return(factory); }
public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory) { return(factory.AddCloudFoundry(includeScopes: false)); }