Ejemplo n.º 1
0
 public static ILoggerFactory AddCloudFoundry(
     this ILoggerFactory factory,
     Func <string, LogLevel, bool> filter)
 {
     factory.AddCloudFoundry(filter, includeScopes: false);
     return(factory);
 }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
 public static ILoggerFactory AddCloudFoundry(
     this ILoggerFactory factory,
     LogLevel minLevel,
     bool includeScopes)
 {
     factory.AddCloudFoundry((category, logLevel) => logLevel >= minLevel, includeScopes);
     return(factory);
 }
Ejemplo n.º 4
0
        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"));
        }
Ejemplo n.º 5
0
 protected virtual void AddLoggingProviders(ILoggerFactory loggerFactory)
 {
     loggerFactory.AddConsole(Configuration.GetSection("Logging"));
     loggerFactory.AddDebug();
     loggerFactory.AddCloudFoundry(Configuration.GetSection("Logging"));
 }
Ejemplo n.º 6
0
        public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory, IConfiguration configuration)
        {
            var settings = new CloudFoundryLoggerSettings(configuration);

            return(factory.AddCloudFoundry(settings));
        }
Ejemplo n.º 7
0
 public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory, LogLevel minLevel)
 {
     factory.AddCloudFoundry(minLevel, includeScopes: false);
     return(factory);
 }
Ejemplo n.º 8
0
 public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory, bool includeScopes)
 {
     factory.AddCloudFoundry((n, l) => l >= LogLevel.Information, includeScopes);
     return(factory);
 }
Ejemplo n.º 9
0
 public static ILoggerFactory AddCloudFoundry(this ILoggerFactory factory)
 {
     return(factory.AddCloudFoundry(includeScopes: false));
 }