Skip to content

[2.0.17]Bug on Util.LogLog ctor. #278

@ylu0105

Description

@ylu0105
static LogLog()
{
#if !NETCF
  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
}

Because the SystemInfo.GetAppSetting method may cause an exception, it can lead to the failure of the QuiteMode property setting for the user.
It is recommended to set the default value of QuiteMode to true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions