Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to log query parameters #1809

Merged
merged 1 commit into from
Mar 23, 2015

Conversation

lukewaters
Copy link
Contributor

Part of issue #1374

@ghost ghost added the cla-not-required label Mar 12, 2015
@@ -462,6 +462,9 @@
<data name="NavigationToSelfDuplicate" xml:space="preserve">
<value>The navigation property '{navigation}' cannot be used for both ends of the relationship. Either specify it on the principal side or the dependent side.</value>
</data>
<data name="DebugLogWarning" xml:space="preserve">
<value>Debug level logging is enabled. At this level, Entity Framework will log sensitive application data such as Sql parameter values. To hide this information configure ILoggerFactory.MinimumLevel to LogLevel.Verbose</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few little things:

  1. Only one space after a period
  2. Recommend using parameter substitutions in the string and passing in either nameof(Foo) or whatever from within the code.
  3. The term "SQL" should be in all caps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressing 2. this is expected to be a static message, I don't expect anything to change, but I can parameterize the names of the log levels if you think that is necessary

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes it easier for the localizers if every bit of the string is actually localizable text. That way we don't have to "lock out" strings to prevent them from being overlocalized.

@lukewaters lukewaters force-pushed the debugLogging branch 2 times, most recently from 60e7841 to c476c57 Compare March 17, 2015 22:19
@lukewaters
Copy link
Contributor Author

@Eilon I've parameterized the values that I don't think we should localize, does this look good?

@Eilon
Copy link
Member

Eilon commented Mar 23, 2015

:shipit: (sorry for delay, was on vacation)

Using the new 'debug' level in logging, this adds the ability to EF to log query parameters
@lukewaters lukewaters merged commit a24c495 into dotnet:dev Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants