Example #1
0
 /// <summary>
 /// Static constructor that initializes logging by reading
 /// settings from the application configuration file.
 /// </summary>
 /// <remarks>
 /// <para>
 /// The <c>log4net.Internal.Debug</c> application setting
 /// controls internal debugging. This setting should be set
 /// to <c>true</c> to enable debugging.
 /// </para>
 /// <para>
 /// The <c>log4net.Internal.Quiet</c> application setting
 /// suppresses all internal logging including error messages.
 /// This setting should be set to <c>true</c> to enable message
 /// suppression.
 /// </para>
 /// </remarks>
 static LogLog()
 {
     try
     {
         InternalDebugging = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Debug"), false);
         QuietMode         = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Quiet"), false);
     }
     catch (Exception ex)
     {
         // If an exception is thrown here then it looks like the config file does not
         // parse correctly.
         //
         // We will leave debug OFF and print an Error message
         Error("LogLog: Exception while reading ConfigurationSettings. Check your .config file is well formed XML.", ex);
     }
 }
Example #2
0
 /// <summary>
 /// Static constructor that initializes logging by reading
 /// settings from the application configuration file.
 /// </summary>
 /// <remarks>
 /// <para>
 /// The <c>log4net.Internal.Debug</c> application setting
 /// controls internal debugging. This setting should be set
 /// to <c>true</c> to enable debugging.
 /// </para>
 /// <para>
 /// The <c>log4net.Internal.Quiet</c> application setting
 /// suppresses all internal logging including error messages.
 /// This setting should be set to <c>true</c> to enable message
 /// suppression.
 /// </para>
 /// </remarks>
 static LogLog()
 {
     s_debugEnabled         = false;
     s_quietMode            = false;
     s_emitInternalMessages = true;
     try
     {
         InternalDebugging    = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Debug"), defaultValue: false);
         QuietMode            = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Quiet"), defaultValue: false);
         EmitInternalMessages = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Emit"), defaultValue: true);
     }
     catch (Exception ex)
     {
         Error(typeof(LogLog), "Exception while reading ConfigurationSettings. Check your .config file is well formed XML.", ex);
     }
 }
Example #3
0
        /// <summary>
        /// Static constructor that initializes logging by reading
        /// settings from the application configuration file.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The <c>log4net.Internal.Debug</c> application setting
        /// controls internal debugging. This setting should be set
        /// to <c>true</c> to enable debugging.
        /// </para>
        /// <para>
        /// The <c>log4net.Internal.Quiet</c> application setting
        /// suppresses all internal logging including error messages.
        /// This setting should be set to <c>true</c> to enable message
        /// suppression.
        /// </para>
        /// </remarks>
        static LogLog()
        {
#if !NETCF && !UNITY_WEBPLAYER
            try
            {
                InternalDebugging    = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Debug"), false);
                QuietMode            = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Quiet"), false);
                EmitInternalMessages = OptionConverter.ToBoolean(SystemInfo.GetAppSetting("log4net.Internal.Emit"), true);
            }
            catch (Exception ex)
            {
                // If an exception is thrown here then it looks like the config file does not
                // parse correctly.
                //
                // We will leave debug OFF and print an Error message
                Error(typeof(LogLog), "Exception while reading ConfigurationSettings. Check your .config file is well formed XML.", ex);
            }
#endif
        }