{"id":19992849,"url":"https://github.com/alexinea/EntityFrameworkCore.LoggingExposure","last_synced_at":"2025-05-04T12:30:27.673Z","repository":{"id":143428231,"uuid":"119719356","full_name":"alexinea/EntityFrameworkCore.LoggingExposure","owner":"alexinea","description":"Support to using EF6-like api in EntityFramework Core 2.x and 3.x","archived":false,"fork":false,"pushed_at":"2019-12-11T07:10:34.000Z","size":56,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:16:51.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexinea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-31T17:25:27.000Z","updated_at":"2024-07-24T09:32:53.000Z","dependencies_parsed_at":"2024-01-13T17:47:47.336Z","dependency_job_id":"0bc42f23-cfde-4f38-955a-8b6bcb64efee","html_url":"https://github.com/alexinea/EntityFrameworkCore.LoggingExposure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexinea%2FEntityFrameworkCore.LoggingExposure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexinea%2FEntityFrameworkCore.LoggingExposure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexinea%2FEntityFrameworkCore.LoggingExposure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexinea%2FEntityFrameworkCore.LoggingExposure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexinea","download_url":"https://codeload.github.com/alexinea/EntityFrameworkCore.LoggingExposure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252333946,"owners_count":21731301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T04:52:21.008Z","updated_at":"2025-05-04T12:30:26.740Z","avatar_url":"https://github.com/alexinea.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# EntityFrameworkCore.LoggingExposure\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure?ref=badge_shield)\n\n\nSupport to using EF6-like api in EntityFrameworkCore, the api looks like `context.ConfigureLogging(...)`.\n\nIn EF6, we can use `context.Database.Log` to get or display SQL Text easily, but this api removed in EF7 (named EFCore today). We have to write much more code by using [Microsoft.Extensions.Logging](https://docs.microsoft.com/en-us/ef/core/miscellaneous/logging). This project solved it, and thanks you, [David Browne](https://blogs.msdn.microsoft.com/dbrowne/2017/09/22/simple-logging-for-ef-core/).\n\n## Install\n\nvia nuget:\n```\nInstall-Package Alexinea.EntityFrameworkCore.LoggingExposure\n```\n\nvia dotnet cli:\n```\ndotnet add package Alexinea.EntityFrameworkCore.LoggingExposure\n```\n\n\n## Usage\n\n```\nusing (var db = new BloggingContext())\n{\n  db.ConfigureLogging( s =\u003e Console.WriteLine(s) );\n  //. . .\n}\n```\n\n```\nusing (var db = new BloggingContext())\n{\n  db.ConfigureLogging( s =\u003e Console.WriteLine(s) , (c,l) =\u003e l == LogLevel.Error || c == DbLoggerCategory.Query.Name);\n  //. . .\n}\n```\n\n```\nusing (var db = new BloggingContext())\n{\n  db.ConfigureLogging(s =\u003e Console.WriteLine(s), LoggingCategories.SQL);\n  //. . .\n}\n```\n\n\n\n## Thanks\n\nSo much thanks to [David Browne](https://blogs.msdn.microsoft.com/dbrowne/2017/09/22/simple-logging-for-ef-core/), all the achievements of this project belong to him. I'm just a porter...emmm.... copied codes and publish it. 😋\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexinea%2FEntityFrameworkCore.LoggingExposure/lists"}