Exemplo n.º 1
0
        private void BootstrapGlobalAsax()
        {
            _configurationRepository =
                ( IConfigurationProvider )DependencyResolver.Current.GetService(typeof(IConfigurationProvider));
            _cookieProvider = ( ICookieProvider )DependencyResolver.Current.GetService(typeof(ICookieProvider));

            _helper = ( IGlobalAsaxHelpers )DependencyResolver.Current.GetService(typeof(IGlobalAsaxHelpers));

            if (_configurationRepository == null)
            {
                throw new ArgumentNullException(nameof(IConfigurationProvider));
            }
            if (_cookieProvider == null)
            {
                throw new ArgumentNullException(nameof(ICookieProvider));
            }
            if (_helper == null)
            {
                throw new ArgumentNullException(nameof(IGlobalAsaxHelpers));
            }

            _applicationConfiguration =
                ( IApplicationConfiguration )DependencyResolver.Current.GetService(typeof(IApplicationConfiguration));

            // store the application configuration object in session cache (for the application scope) ...
            _sessionCacheProvider.SaveForApplication(_applicationConfiguration, "ApplicationConfiguration");


            _loggingFactory =
                ( ISerilogLoggingFactory )DependencyResolver.Current.GetService(typeof(ISerilogLoggingFactory));
            var loggingContext = new LoggingContextProvider();

            _logger = new SerilogErrorLogProvider(_loggingFactory, loggingContext);
        }
 public UserGrantQuery(
     AppDbContext context
     , ISerilogLoggingFactory loggingFactory
     )
 {
     _context        = context;
     _loggingFactory = loggingFactory;
 }
        public SerilogErrorLogProvider(
            ISerilogLoggingFactory loggingFactory
            , IAddLoggingContextProvider addLoggingContext
            )
        {
            _loggingFactory = loggingFactory ?? throw new ArgumentNullException(nameof(loggingFactory));
            _loggingContext = addLoggingContext ?? throw new ArgumentNullException(nameof(addLoggingContext));

            SetupErrorLogger();
        }
Exemplo n.º 4
0
        public PerformanceLogProvider(
            ISerilogLoggingFactory loggingFactory,
            IAddLoggingContextProvider addLoggingContext,
            IApplicationConfiguration applicationConfiguration
            )
        {
            var loggingFactory1 = loggingFactory ?? throw new ArgumentNullException(nameof(loggingFactory));

            _loggingContext           = addLoggingContext ?? throw new ArgumentNullException(nameof(addLoggingContext));
            _applicationConfiguration = applicationConfiguration ??
                                        throw new ArgumentNullException(nameof(applicationConfiguration));
            _loggingService = loggingFactory1.GetLogger(SerilogLogTypesEnum.PerformanceLog);
        }
Exemplo n.º 5
0
        public SerilogAuditLogProvider(
            ISerilogLoggingFactory loggingFactory,
            IAddLoggingContextProvider addLoggingContext,
            IConfigurationProvider configurationRepository, AppEnvironmentEnum environment)
        {
            _loggingFactory = loggingFactory ?? throw new ArgumentNullException(nameof(loggingFactory));
            _loggingContext = addLoggingContext ?? throw new ArgumentNullException(nameof(addLoggingContext));
            _environment    = environment;

            _applicationId =
                configurationRepository.GetConfigurationValueAndNotifyIfPropertyNotFound <string>("ApplicationId");

            if (_loggingService == null)
            {
                _loggingService = _loggingFactory.GetLogger(SerilogLogTypesEnum.NiasMessageAudit);
            }
        }
        public RollingFileErrorLogProvider(ISerilogLoggingFactory loggingFactory)
        {
            _loggingFactory = loggingFactory ?? throw new ArgumentNullException(nameof(loggingFactory));

            SetupErrorLogger();
        }