コード例 #1
0
ファイル: Startup.cs プロジェクト: okusnadi/AspNet5Filters
        public void ConfigureServices(IServiceCollection services)
        {
            var loggerFactory = new LoggerFactory { MinimumLevel = LogLevel.Debug };
            loggerFactory.AddConsole();
            loggerFactory.AddDebug();

            services.AddMvc(
                config =>
                    {
                        config.Filters.Add(new GlobalFilter(loggerFactory));
                    });

            services.AddScoped<ConsoleLogActionOneFilter>();
            services.AddScoped<ConsoleLogActionTwoFilter>();
            services.AddScoped<ClassConsoleLogActionBaseFilter>();
            services.AddScoped<ClassConsoleLogActionOneFilter>();
        }