コード例 #1
0
 public void Init(Entities.EntityApp app)
 {
     _log = app.GetService <INotificationLogService>();
     //init providers
     foreach (var prov in _providers)
     {
         prov.Init(app);
     }
 }
コード例 #2
0
ファイル: LoggingEntityApp.cs プロジェクト: kouweizhong/vita
        public LoggingEntityApp(string schema = "log", LogModules includeModules = LogModules.All,
                                UserSessionSettings sessionSettings = null) : base("LoggingApp", CurrentVersion)
        {
            var area = base.AddArea(schema);

            ActiveModules = includeModules;
            // DbInfo module is not shared with main app, it is local for the database
            var dbInfo = new DbInfoModule(area);

            // ErrorLog is property in EntityApp, will be set there automatically
            if (ActiveModules.IsSet(LogModules.ErrorLog))
            {
                var errLog = new ErrorLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.OperationLog))
            {
                OperationLog = new OperationLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.IncidentLog))
            {
                IncidentLog = new IncidentLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.TransactionLog))
            {
                TransactionLog = new TransactionLogModule(area, trackHostApp: false); //do not track changes for LoggingApp itself
            }
            if (ActiveModules.IsSet(LogModules.NotificationLog))
            {
                NotificationLog = new NotificationLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.LoginLog))
            {
                LoginLog = new LoginLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.DbUpgradeLog))
            {
                DbUpgradeLog = new DbUpgradeLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.UserSession))
            {
                SessionService = new UserSessionModule(area, sessionSettings);
            }
            if (ActiveModules.IsSet(LogModules.EventLog))
            {
                EventLogService = new EventLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.WebCallLog))
            {
                WebCallLog = new WebCallLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.WebClientLog))
            {
                WebClientLogService = new WebClientLogModule(area);
            }
        }
コード例 #3
0
ファイル: NotificationService.cs プロジェクト: yuanfei05/vita
 public void Init(Entities.EntityApp app) {
   _log = app.GetService<INotificationLogService>(); 
   //Create default email notification provider, if there's IEmailSendService registered
   if (_providers.Count == 0) {
     var smtp = _app.GetService<IEmailSendService>();
     if (smtp != null)
       _providers.Add(new EmailNotificationProvider(_app));
   }
   //init providers
   foreach (var prov in _providers)
     prov.Init(app); 
 }
コード例 #4
0
ファイル: LoggingEntityApp.cs プロジェクト: yuanfei05/vita
 public LoggingEntityApp(string schema = "log", UserSessionSettings sessionSettings = null)
     : base("LoggingApp", CurrentVersion)
 {
     var area = base.AddArea(schema);
       var errorLog = new ErrorLogModule(area);
       OperationLog = new OperationLogModule(area);
       IncidentLog = new IncidentLogModule(area);
       TransactionLog = _transactionLogModule = new TransactionLogModule(area);
       WebCallLog = new WebCallLogModule(area);
       NotificationLog = new NotificationLogModule(area);
       LoginLog = new LoginLogModule(area);
       DbModelChangeLog = new DbUpgradeLogModule(area);
       SessionService = new UserSessionModule(area, sessionSettings);
       DbInfoService = new DbInfoModule(area);
       EventLogService = new EventLogModule(area);
 }