Entity Framework Core supports logging through an instance of an ILoggerFactory. In this section, Phil demonstrates how to add the Console Logging Provider into an EF applications.
- [Instructor] Let's talk about EF Core Logging.…Now EF Core integrates with ASP.NET core logging…automatically through the AddDbContext…or AddDbContextPool.…If you want to see this in action,…you can certainly see that in either one…of my three courses that feature…ASP.NET Core, that's migrating MVC 5 to ASP.NET Core,…migrating Web API 2.2 and my latest course,…which is the new features by version…with an ASP.NET Core.…
Other applications require an instance of…ILoggerFactory to be configured.…We need to make it a static property,…that you can only have one LoggerFactory.…And in this example you see on your screen,…I'm using the ConsoleLoggerProvider.…We can add additional logger providers,…we can configure them well beyond the scope of this course…and then we just need to, in the optionsBuilder,…say, "UseLoggerFactory," passing in that static instance.…
So let's go ahead and configure the application for logging,…and then we can see the results of the logging in action.…Now we need to create an instance of a LoggerFactory.…
- Entity Framework Core components and projects
- Working with scaffolded files
- Testing with xUnit
- Viewing generated SQL
- Composing queries
- Sorting and filtering results
- Working with aggregates
- Loading related data
- Logging and tracking
- Mapping functions
- Generics and delegates
- Checking concurrency
- Resiliency and transactions
Skill Level Intermediate
Learning Entity Framework Corewith Reynald Adolphe1h 35m Intermediate
1. Get to Know Entity Framework
2. Set the Stage
3. Querying Data: Part 1
4. Querying Data: Part 2
5. Advanced Query Features
6. Persisting Data
7. DbContext Options and Configuration
Thank you1m 23s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.