public ApplicationLogger(CoreClient client, ApplicationLogDatabase logDb)
 {
     Args.ThrowIfNull(client, "client");
     CoreClient = client;
     _daoLogger = new DaoLogger2(logDb)
     {
         CommitCycleDelay = 5000
     };
 }
Exemple #2
0
        private static ServiceRegistry GetServiceRegistry(CoreClient coreClient)
        {
            string contentRoot        = DefaultConfiguration.GetAppSetting("ContentRoot", "c:\\bam\\content");
            string organization       = DefaultConfiguration.GetAppSetting("Organization", "PUBLIC");
            string applicationName    = DefaultConfiguration.GetAppSetting("ApplicationName", "UNKNOWN");
            string databasesPath      = Path.Combine(contentRoot, "Databases");
            string workspaceDirectory = Path.Combine(contentRoot, "Workspace");

            ApplicationLogDatabase logDb = new ApplicationLogDatabase(workspaceDirectory);

            return((ServiceRegistry)(new ServiceRegistry())
                   .For <CoreClient>().Use(coreClient)
                   .For <ApplicationLogDatabase>().Use(logDb)
                   .For <ILogger>().Use <ApplicationLogger>()
                   .For <ILog>().Use <ApplicationLogger>()
                   .For <IConfigurationService>().Use <ApplicationConfigurationProvider>()
                   .For <IUserManager>().Use(coreClient.UserRegistryService));
        }