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

Document EnableSensitiveDataLogging #673

Closed
divega opened this issue Apr 10, 2018 · 4 comments · Fixed by #2787
Closed

Document EnableSensitiveDataLogging #673

divega opened this issue Apr 10, 2018 · 4 comments · Fixed by #2787

Comments

@divega
Copy link
Contributor

divega commented Apr 10, 2018

From @Wain123 on June 22, 2017 11:7

I have an ILogger with the following function:

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) {
  Console.WriteLine(formatter(state, exception));
}

DbCommands get logged and the CommandText looks correct, but all the parameter values are simply '?'. Here's a sample output from the Logger:

Executed DbCommand (78ms) [Parameters=[p0='?', p1='?' (Size = 1), p2='?', p3='?' (Size = 6), p4='?', p5='?' (Size = 1), p6='?', p7='?', p8='?' (Size = 6)], CommandType='Text', CommandTimeout='0']
INSERT INTO FRM_LAYOUT_FILTER (SEQNR, BEZEICHNUNG, CREATETIME, CREATEUSER, DEFAULT_FILTER, FORM_NAME, MODIFY_NR, MODIFYTIME, MODIFYUSER)
VALUES (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8)

Copied from original issue: dotnet/efcore#8933

@divega
Copy link
Contributor Author

divega commented Apr 10, 2018

From @smitpatel on June 22, 2017 14:21

By default EF doesn't put data in logs as the data may contain sensitive information. To get those parameter values, you need to chain EnableSensitiveDataLogging() after your UseSqlServer (or equivalent method)
e.g.
builder.UseSqlServer("connectionstring").EnableSensitiveDataLogging()

@divega
Copy link
Contributor Author

divega commented Apr 10, 2018

From @jayoungers on August 23, 2017 17:55

How is that not mentioned here?

https://docs.microsoft.com/en-us/ef/core/miscellaneous/logging

@divega
Copy link
Contributor Author

divega commented Apr 10, 2018

From @smitpatel on August 23, 2017 21:26

@divega For doc issue

@divega
Copy link
Contributor Author

divega commented Apr 10, 2018

From @ajcvickers on April 10, 2018 18:57

@divega Can this be moved out of the 2.1 milestone. (We are trying to make 2.1 only include issues that we must fix for 2.1)

@divega divega changed the title Logging DbCommands: All parameters are '?' Document EnabkeSensitiveDataLogging Apr 11, 2018
@divega divega changed the title Document EnabkeSensitiveDataLogging Document EnableSensitiveDataLogging Apr 11, 2018
@ajcvickers ajcvickers added this to the 2.1.0 milestone Apr 24, 2018
@divega divega modified the milestones: 2.1.0, 2.2.0 Jul 10, 2018
@divega divega added help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. and removed closed-question propose-punt labels Jul 31, 2018
@tdykstra tdykstra self-assigned this Oct 1, 2018
@divega divega removed help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. labels Nov 10, 2018
@divega divega modified the milestones: 2.2.0, 3.0.0 Feb 21, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, Backlog Aug 28, 2019
@ajcvickers ajcvickers modified the milestones: Backlog, 3.1.0 Sep 6, 2019
@ajcvickers ajcvickers self-assigned this Sep 6, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0, Backlog Sep 6, 2019
@ajcvickers ajcvickers modified the milestones: Backlog, 5.0.0 Jan 15, 2020
ajcvickers added a commit that referenced this issue Oct 17, 2020
**No TOC yet since we need to decide what to do with `Fundamentals`. @smitpatel I do not intend to merge this way.**

* Fixes #2615: Add information on controlling suppressing warnings and otherwise configuring EventIds
* Fixes #2557: Support logging on DB level #2557
* Fixes #2770: Add entry in TOC for logging/interceptors
* Fixes #583: Document how to use DiagnosticSource/DiagnosticListener
* Fixes #673: Document EnableSensitiveDataLogging
* Fixes #1913: Interception of database operations: InterceptionResult or InterceptionResult<DbDataReader>?
* Fixes #1543: Document database interceptors with examples
* Fixes #955: Document EnableRichDataErrorHandling
* Fixes #661: EF Core 2.1: document state change events
ajcvickers added a commit that referenced this issue Oct 17, 2020
**No TOC yet since we need to decide what to do with `Fundamentals`. @smitpatel I do not intend to merge this way.**

* Fixes #2615: Add information on controlling suppressing warnings and otherwise configuring EventIds
* Fixes #2557: Support logging on DB level #2557
* Fixes #2770: Add entry in TOC for logging/interceptors
* Fixes #583: Document how to use DiagnosticSource/DiagnosticListener
* Fixes #673: Document EnableSensitiveDataLogging
* Fixes #1913: Interception of database operations: InterceptionResult or InterceptionResult<DbDataReader>?
* Fixes #1543: Document database interceptors with examples
* Fixes #955: Document EnableRichDataErrorHandling
* Fixes #661: EF Core 2.1: document state change events
ajcvickers added a commit that referenced this issue Oct 17, 2020
**No TOC yet since we need to decide what to do with `Fundamentals`. @smitpatel I do not intend to merge this way.**

* Fixes #2615: Add information on controlling suppressing warnings and otherwise configuring EventIds
* Fixes #2557: Support logging on DB level #2557
* Fixes #2770: Add entry in TOC for logging/interceptors
* Fixes #583: Document how to use DiagnosticSource/DiagnosticListener
* Fixes #673: Document EnableSensitiveDataLogging
* Fixes #1913: Interception of database operations: InterceptionResult or InterceptionResult<DbDataReader>?
* Fixes #1543: Document database interceptors with examples
* Fixes #955: Document EnableRichDataErrorHandling
* Fixes #661: EF Core 2.1: document state change events
ajcvickers added a commit that referenced this issue Oct 17, 2020
**No TOC yet since we need to decide what to do with `Fundamentals`. @smitpatel I do not intend to merge this way.**

* Fixes #2615: Add information on controlling suppressing warnings and otherwise configuring EventIds
* Fixes #2557: Support logging on DB level #2557
* Fixes #2770: Add entry in TOC for logging/interceptors
* Fixes #583: Document how to use DiagnosticSource/DiagnosticListener
* Fixes #673: Document EnableSensitiveDataLogging
* Fixes #1913: Interception of database operations: InterceptionResult or InterceptionResult<DbDataReader>?
* Fixes #1543: Document database interceptors with examples
* Fixes #955: Document EnableRichDataErrorHandling
* Fixes #661: EF Core 2.1: document state change events
ajcvickers added a commit that referenced this issue Nov 9, 2020
**No TOC yet since we need to decide what to do with `Fundamentals`. @smitpatel I do not intend to merge this way.**

* Fixes #2615: Add information on controlling suppressing warnings and otherwise configuring EventIds
* Fixes #2557: Support logging on DB level #2557
* Fixes #2770: Add entry in TOC for logging/interceptors
* Fixes #583: Document how to use DiagnosticSource/DiagnosticListener
* Fixes #673: Document EnableSensitiveDataLogging
* Fixes #1913: Interception of database operations: InterceptionResult or InterceptionResult<DbDataReader>?
* Fixes #1543: Document database interceptors with examples
* Fixes #955: Document EnableRichDataErrorHandling
* Fixes #661: EF Core 2.1: document state change events
ajcvickers added a commit that referenced this issue Nov 10, 2020
* Fixes #2615: Add information on controlling suppressing warnings and otherwise configuring EventIds
* Fixes #2557: Support logging on DB level #2557
* Fixes #2770: Add entry in TOC for logging/interceptors
* Fixes #583: Document how to use DiagnosticSource/DiagnosticListener
* Fixes #673: Document EnableSensitiveDataLogging
* Fixes #1913: Interception of database operations: InterceptionResult or InterceptionResult<DbDataReader>?
* Fixes #1543: Document database interceptors with examples
* Fixes #955: Document EnableRichDataErrorHandling
* Fixes #661: EF Core 2.1: document state change events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants