예제 #1
0
        private void LoadGlobalConfig()
        {
            var data = _jsonConfigReader.Read(GlobalConfigFilename); // read the global config data.

            // make sure we were able to load global config.
            if (data == null)
            {
                // gracefully exit
                _logger.Error("Couldn't read config/config.json! Make sure you rename config/config-example.json as config/config.json.");
                Environment.Exit(-1);
            }

            // load log config.
            LogConfig = new LogConfig(data.logging);  // read the log config first, so rest of the config loaders can use log subsystem.
            _logManager.EmitConfiguration(LogConfig); // assign the log configuration to log manager.

            // print a version banner.
            _logger.Information("CoiniumServ {0:l} {1:l} warming-up..", VersionInfo.CodeName, Assembly.GetAssembly(typeof(Program)).GetName().Version);
            PlatformManager.PrintPlatformBanner();

            // load rest of the configs.
            StackConfig      = new StackConfig(data.stack);
            StatisticsConfig = new StatisticsConfig(data.statistics);
            WebServerConfig  = new WebServerConfig(data.website);
        }