Aqueduct.Diagnostics.Log4NetInitialiser.Initialise C# (CSharp) Method

Initialise() static private method

static private Initialise ( string configFilePath ) : void
configFilePath string
return void
        internal static void Initialise(string configFilePath)
        {
            if (string.IsNullOrEmpty(configFilePath))
                throw new ArgumentException("Configuration file path not specified.", "configFilePath");

            SetInternalDebugging();
            XmlConfigurator.ConfigureAndWatch(new FileInfo(configFilePath));
        }

Usage Example

コード例 #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);
        }