public object UpdateFilterUserSection(string AppID, UpdateFilterUserSectionContext Data)
        {
            LoggingFilter objData = (LoggingFilter)General.ErrorLogging.Data.LoggingFilter.GetFilter(Data.FilterID);

            objData.UserFilter = Data.FilterSection;
            return(General.ErrorLogging.Data.LoggingFilter.UpdateLoggingFilter(objData));
        }
示例#2
0
 public FrameLogModule(IChangeSetFactory <TChangeSet, TPrincipal> factory,
                       IFrameLogContext <TChangeSet, TPrincipal> context)
 {
     this.factory = factory;
     this.context = context;
     this.filter  = LoggingFilter.Get(context);
     Enabled      = true;
 }
示例#3
0
 public ChangeLogger(IFrameLogContext <TChangeSet, TPrincipal> context,
                     IChangeSetFactory <TChangeSet, TPrincipal> factory,
                     LoggingFilter filter)
 {
     this.context  = context;
     this.factory  = factory;
     this.recorder = new Recorder <TChangeSet, TPrincipal>(factory);
     this.filter   = filter;
 }
        public ILoggingFilter UpdateFilterMeta(string AppID, LoggingFilter filter)
        {
            //This will update the non-Json fields only.
            LoggingFilter objData = (LoggingFilter)General.ErrorLogging.Data.LoggingFilter.GetFilter(filter.ID);

            objData.Name      = filter.Name;
            objData.Enabled   = filter.Enabled;
            objData.StartDate = filter.StartDate;
            objData.EndDate   = filter.EndDate;
            objData.PageSMS   = filter.PageSMS;
            objData.PageEmail = filter.PageEmail;
            return(General.ErrorLogging.Data.LoggingFilter.UpdateLoggingFilter(objData));
        }
示例#5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // DI initialisation
            services.AddSingleton(typeof(IMongoDbContext), typeof(MongoDbContext));
            services.AddSingleton(typeof(ILoggerService), typeof(LoggerService));
            services.AddScoped(typeof(IAssetService), typeof(AssetService));
            services.AddScoped(typeof(IHttpContextAccessor), typeof(HttpContextAccessor));
            services.AddScoped(typeof(LoggingFilter), typeof(LoggingFilter));
            services.AddScoped(typeof(IModelsService), typeof(ModelsService));

            // Application config
            services.Configure <AppSettings>(Configuration.GetSection("AppSettings"));

            var           serviceProvider = services.BuildServiceProvider();
            LoggingFilter loggingFilter   = serviceProvider.GetService <LoggingFilter>();

            // Add framework services.
            services.AddMvc(options =>
            {
                options.Filters.Add(loggingFilter);
            });

            services.AddSwaggerGen();
            services.ConfigureSwaggerGen(options =>
            {
                options.SingleApiVersion(new Info
                {
                    Version        = "v1",
                    Title          = "DAM API",
                    Description    = "DAM Services",
                    TermsOfService = "NA",
                    Contact        = new Contact()
                    {
                        Name = "yDevs", Email = "*****@*****.**", Url = "http://www.ydevs.com"
                    }
                });
            });

            // Enable CORS
            services.AddCors(options =>
                             options.AddPolicy("CorsPolicy",
                                               builder => builder.AllowAnyOrigin()
                                               .AllowAnyHeader()
                                               .AllowAnyMethod()
                                               .AllowCredentials())
                             );
        }
示例#6
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <ForwardedHeadersOptions>(options =>
            {
                options.ForwardedHeaders      = ForwardedHeaders.All;
                options.RequireHeaderSymmetry = false;
            });

            services.AddDbContext <IdentityDataContext>();

            services.AddIdentity <VoatIdentityUser, IdentityRole>(x => {
                x.Password = VoatSettings.Instance.PasswordOptions;
            }).AddEntityFrameworkStores <IdentityDataContext>()
            .AddUserManager <VoatUserManager>()
            .AddDefaultTokenProviders();


            services.ConfigureApplicationCookie(options => {
                if (!String.IsNullOrEmpty(VoatSettings.Instance.CookieDomain))
                {
                    options.Cookie.Domain = VoatSettings.Instance.CookieDomain;
                }
                if (!String.IsNullOrEmpty(VoatSettings.Instance.CookieName))
                {
                    options.Cookie.Name = VoatSettings.Instance.CookieName;
                }
                options.AccessDeniedPath = new PathString("/error/default");
            });

            var mvcBuilder = services.AddMvc();

            services.Configure <RazorViewEngineOptions>(options => {
                options.ViewLocationExpanders.Add(new ViewLocationExpander());
            });

            mvcBuilder.AddMvcOptions(o => {
                o.Filters.Add(typeof(GlobalExceptionFilter));
                o.Filters.Add(typeof(RuntimeStateFilter));
                o.Filters.Add(typeof(RouteLoggerFilter));
            });

            services.AddAntiforgery(options => {
                options.HeaderName    = Utilities.CONSTANTS.REQUEST_VERIFICATION_HEADER_NAME;
                options.FormFieldName = Utilities.CONSTANTS.REQUEST_VERIFICATION_HEADER_NAME;
            });

            // Add application services.
            services.AddScoped <IViewRenderService, ViewRenderService>();
            //services.AddScoped<VoatUserManager, VoatUserManager>();

            //services.AddTransient<IEmailSender, AuthMessageSender>();
            //services.AddTransient<ISmsSender, AuthMessageSender>();

            services.AddLogging(loggingBuilder =>
            {
                //Can not figure out how to filter out native log statements (i.e. Microsoft.AspNetCore.Mvc...) from logging
                //using the default format json. So have to implement a custom filter.
                //loggingBuilder.AddConfiguration(Configuration.GetSection("Logging"));
                var filter = new LoggingFilter();
                loggingBuilder.AddFilter(filter.Filter);
            });
        }
 public ILoggingFilter Put(string AppID, LoggingFilter filter)
 {
     return(General.ErrorLogging.Data.LoggingFilter.UpdateLoggingFilter(filter));
 }
 public ILoggingFilter CreateFilter(string AppID, LoggingFilter filter)
 {
     return(General.ErrorLogging.Data.LoggingFilter.CreateLoggingFilter(filter));
 }