/// <summary>
        /// <param name="RemoteAddress" value="127.0.0.1" />
        //<param name = "RemotePort" value="8080" />
        //<layout type = "log4net.Layout.XmlLayout" >

        //          < param name="Prefix" value="" />
        //</layout>
        /// </summary>
        public static void AppendToConfiguration()
        {
            //First create and configure the appender
            var appender = new UdpAppender();

            appender.Name = "UdpAppender";
            var layout = new XmlLayout();

            layout.Prefix          = "";
            appender.Layout        = layout;
            appender.RemotePort    = 8080;
            appender.RemoteAddress = "127.0.0.1";

            //Notify the appender on the configuration changes
            appender.ActivateOptions();

            //Get the logger repository hierarchy.
            var repository = LogManager.GetRepository() as Hierarchy;

            if (repository == null)
            {
                return;
            }

            //and add the appender to the root level
            //of the logging hierarchy
            repository.Root.AddAppender(appender);

            //mark repository as configured and
            //notify that is has changed.
            repository.Configured = true;
            repository.RaiseConfigurationChanged(EventArgs.Empty);
        }
Esempio n. 2
0
        private void BuildContainer(DocumentStoreConfiguration config)
        {
            _container = new WindsorContainer();
            ContainerAccessor.Instance = _container;
            _container.Register(Component.For <DocumentStoreConfiguration>().Instance(config));
            _container.Kernel.Resolver.AddSubResolver(new CollectionResolver(_container.Kernel, true));
            _container.Kernel.Resolver.AddSubResolver(new ArrayResolver(_container.Kernel, true));

            _container.AddFacility <LoggingFacility>(config.CreateLoggingFacility);

#if DEBUG
            UdpAppender.AppendToConfiguration();
#endif

            _container.AddFacility <StartableFacility>();
            _container.AddFacility <JarvisTypedFactoryFacility>();

            _logger = _container.Resolve <ILoggerFactory>().Create(GetType());
        }