public HostRuntimeConfiguration()
 {
     Server = new List<ServiceTypeConfiguration>();
     SuperUser = new UserElement();
     Audit = new AuditElement();
     LogInfo = new LogElement();
 }
 public HostRuntimeConfiguration()
 {
     Server    = new List <ServiceTypeConfiguration>();
     SuperUser = new UserElement();
     Audit     = new AuditElement();
     LogInfo   = new LogElement();
 }
 public ClientRuntimeConfiguration()
 {
     User = new UserElement();
     Client = new ClientServiceTypeConfiguration();
     LogInfo = new LogElement
     {
         ProviderType = typeof (Logger).AssemblyQualifiedName
     };
 }
Example #4
0
        internal static BaseLogger CreateInstance(LogElement logElement)
        {
            if (_instance == null)
            {
                Type providerType = Type.GetType(logElement.ProviderType);
                if (providerType == null)
                    throw new InvalidConfigurationException("Could not locate Log Provider :" + logElement.ProviderType);

                if (!providerType.ImplementsClass<BaseLogger>())
                    throw new InvalidConfigurationException("Log Provider does not implement ILogger:" +
                                                            logElement.ProviderType);

                var args = new CommandArgs(logElement.Parameters);
                _instance = (BaseLogger) Activator.CreateInstance(providerType, args);
            }

            return _instance;
        }
Example #5
0
        private UnitTestContext(IArguments arguments)
        {
            if (arguments == null)
                throw new InvalidOperationException(
                    "Current Context could not be initialized. No arguments passed to the context");

            var element = new LogElement
            {
                Parameters = "-ShowOnConsole:true ",
                ProviderType = "KonfDB.Infrastructure.Logging.Logger, KonfDBC"
            };

            if (arguments.ContainsKey("runtime-logConfigPath"))
                element.Parameters += "-path:" + arguments["runtime-logConfigPath"];

            var logger = LogFactory.CreateInstance(element);

            CurrentContext.CreateDefault(logger, arguments, null);
        }