Пример #1
0
        /// <summary>Loads the NLog.config file from the <see cref="DataFolder"/>, if it exists.</summary>
        public static ILoggerFactory Create(LogSettings settings)
        {
            return(ExtendedLoggerFactory.Create(builder =>
            {
                LoggingConfiguration.ConfigureConsoleFilters(builder, settings);

                builder.AddFilter("Default", LogLevel.Information)
                .AddFilter("System", LogLevel.Warning)
                .AddFilter("Microsoft", LogLevel.Warning)
                .AddFilter("Microsoft.AspNetCore", LogLevel.Error)
                .AddFilter <ConsoleLoggerProvider>($"{nameof(Blockcore)}.*", LogLevel.Information)
                .AddConsole();

                builder.SetMinimumLevel(LogLevel.Debug);
            }
                                                ));
        }