コード例 #1
0
        /// <summary>
        /// Initialises <see cref="AppLogger"/> using the specified config file.
        /// </summary>
        /// <param name="configFilePath">Name of the config file to load configuration from.</param>
        /// <param name="loggerName">Name of the logger to use for logging.</param>
        /// <exception cref="ArgumentException">when <paramref name="configFilePath"/> is null or empty.</exception>
        /// /// <exception cref="ArgumentException">when <paramref name="loggerName"/> is null or empty.</exception>
        public static void Initialise(string configFilePath, string loggerName)
        {
            Log4NetInitialiser.Initialise(configFilePath);

            if (string.IsNullOrEmpty(loggerName))
            {
                throw new ArgumentException("Logger name not specified.", "loggerName");
            }

            m_globalLogger = new Logger(loggerName);
        }
コード例 #2
0
        /// <summary>
        /// Initialises <see cref="AppLogger"/> using the Aqueduct.Config file.
        /// </summary>
        /// <remarks>Uses the contents of the Diagnostics.Config setting to Initialise the logger</remarks>
        /// <remarks>To enable the intrelnal log debugging set Diagnostics.InternalDebugMode setting to true</remarks>
        public static void InitialiseFromConfig(string loggerName)
        {
            Log4NetInitialiser.InitialiseUsingConfig();
            Config.SettingsChanged += (sender, args) => { Log4NetInitialiser.InitialiseUsingConfig(); };

            if (string.IsNullOrEmpty(loggerName))
            {
                throw new ArgumentException("Logger name not specified.", "loggerName");
            }

            m_globalLogger = new Logger(loggerName);
        }