How do I make CloudConfigurationManager.GetSetting less verbose?

后端 未结 8 1405
天命终不由人
天命终不由人 2021-01-04 01:05

I\'m currently using CloudConfigurationManager.GetSetting(\"setting\") to get settings for my application, but it\'s writing logs of everything it\'s checking to the console

8条回答
  •  死守一世寂寞
    2021-01-04 01:49

    There are two separate issues here:

    1. Setting values are logged in plain text (a security concern)
    2. Messages are logged every time a setting is retrieved (a verbosity concern)

    As others have noted, #1 has been fixed in a more recent version of the plugin.

    Based on my experience (and some of the other responses here), #2 is still a huge annoyance.

    Looking at WADLogsTable in Visual Studio's Queue Editor, note that the message level is 5 (i.e. verbose, according to this list of ETW levels).

    Going off of the diagnostic config file schema, my approach to solving issue #2 was to limit the minimum severity level (e.g. warning, informational, verbose) of generic tracing to "information" (or more severe) and just ensure my own logging did not use the "verbose" level.

    Here is the change I made in diagnostics.wadcfgx:

    Original:

    
    

    Fixed:

    
    

提交回复
热议问题