Example #1
0
        /// <summary>
        /// Initialize the log4net system using the specified appender
        /// </summary>
        /// <param name="appender">the appender to use to log all logging events</param>
        /// <remarks>
        /// <para>
        /// This method provides the same functionality as the
        /// <see cref="IBasicRepositoryConfigurator.Configure"/> method implemented
        /// on this object, but it is protected and therefore can be called by subclasses.
        /// </para>
        /// </remarks>
        protected void BasicRepositoryConfigure(log4net.Appender.IAppender appender)
        {
            Root.AddAppender(appender);

            Configured = true;

            // Notify listeners
            OnConfigurationChanged(null);
        }
        /// <summary>
        /// Initialise the log4net system using the specified appender
        /// </summary>
        /// <param name="appender">the appender to use to log all logging events</param>
        void IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender appender)
        {
            Root.AddAppender(appender);

            Configured = true;

            // Notify listeners
            FireConfigurationChangedEvent();
        }
Example #3
0
        /// <summary>
        /// Initialize the log4net system using the specified appenders
        /// </summary>
        /// <param name="appenders">the appenders to use to log all logging events</param>
        /// <remarks>
        /// <para>
        /// This method provides the same functionality as the
        /// <see cref="M:IBasicRepositoryConfigurator.Configure(IAppender)" /> method implemented
        /// on this object, but it is protected and therefore can be called by subclasses.
        /// </para>
        /// </remarks>
        protected void BasicRepositoryConfigure(params IAppender[] appenders)
        {
            ArrayList arrayList = new ArrayList();

            using (new LogLog.LogReceivedAdapter(arrayList))
            {
                foreach (IAppender newAppender in appenders)
                {
                    Root.AddAppender(newAppender);
                }
            }
            Configured            = true;
            ConfigurationMessages = arrayList;
            OnConfigurationChanged(new ConfigurationChangedEventArgs(arrayList));
        }
Example #4
0
        /// <summary>
        /// Initialize the GodLesZ.Library.Logging system using the specified appenders
        /// </summary>
        /// <param name="appenders">the appenders to use to log all logging events</param>
        /// <remarks>
        /// <para>
        /// This method provides the same functionality as the
        /// <see cref="IBasicRepositoryConfigurator.Configure(IAppender)"/> method implemented
        /// on this object, but it is protected and therefore can be called by subclasses.
        /// </para>
        /// </remarks>
        protected void BasicRepositoryConfigure(params IAppender[] appenders)
        {
            ArrayList configurationMessages = new ArrayList();

            using (new LogLog.LogReceivedAdapter(configurationMessages)) {
                foreach (IAppender appender in appenders)
                {
                    Root.AddAppender(appender);
                }
            }

            Configured = true;

            ConfigurationMessages = configurationMessages;

            // Notify listeners
            OnConfigurationChanged(new ConfigurationChangedEventArgs(configurationMessages));
        }