You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API linked to above has been introduced for 5.0, which hasn't yet been released. Until that happens, you can still configure logging in EF Core as detailed in this page.
Ok, but this change logger for all entire DBContext.
In project which I am upgrading to EF Core there is only one call to DbContext.Database.Log - in only one controller endpoint.
How to achieve this in EF Core 5.0 preview 6?
Activity
ErikEJ commentedon Jul 28, 2020
There is a new API for logging now: https://erikej.github.io/efcore/2020/05/18/ef-core-simple-logging.html
roji commentedon Jul 28, 2020
The API linked to above has been introduced for 5.0, which hasn't yet been released. Until that happens, you can still configure logging in EF Core as detailed in this page.
Saibamen commentedon Jul 28, 2020
Ok, but this change logger for all entire
DBContext.In project which I am upgrading to EF Core there is only one call to
DbContext.Database.Log- in only one controller endpoint.How to achieve this in EF Core 5.0 preview 6?
ajcvickers commentedon Aug 3, 2020
@Saibamen You could setup a switch on the context to allow logging to be switched on when needed. For example:
ErikEJ commentedon Aug 3, 2020
Could be a useful addition to the docs.
Saibamen commentedon Aug 3, 2020
Thanks
Docs for logging, events, and diagnostics
Docs for logging, events, and diagnostics
Docs for logging, events, and diagnostics
Docs for logging, events, and diagnostics
Docs for logging, events, and diagnostics
Docs for logging, events, and diagnostics (#2787)