{"id":24227599,"url":"https://github.com/ianwold/aspnetcoretestlogoutput","last_synced_at":"2026-06-12T09:31:18.059Z","repository":{"id":272064544,"uuid":"915417814","full_name":"IanWold/AspNetCoreTestLogOutput","owner":"IanWold","description":"A simple demonstration of testing log output in an ASP.NET Core integration test","archived":false,"fork":false,"pushed_at":"2025-01-12T17:15:06.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T06:14:37.802Z","etag":null,"topics":["asp-net","asp-net-core","dotnet","dotnet-core","ilogger","iloggerprovider","integration-testing","logging","netcore","testing"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IanWold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-11T19:46:17.000Z","updated_at":"2025-01-12T17:15:10.000Z","dependencies_parsed_at":"2025-01-11T20:41:54.304Z","dependency_job_id":null,"html_url":"https://github.com/IanWold/AspNetCoreTestLogOutput","commit_stats":null,"previous_names":["ianwold/aspnetcoretestlogoutput"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FAspNetCoreTestLogOutput","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FAspNetCoreTestLogOutput/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FAspNetCoreTestLogOutput/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IanWold%2FAspNetCoreTestLogOutput/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IanWold","download_url":"https://codeload.github.com/IanWold/AspNetCoreTestLogOutput/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241794136,"owners_count":20021192,"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":["asp-net","asp-net-core","dotnet","dotnet-core","ilogger","iloggerprovider","integration-testing","logging","netcore","testing"],"created_at":"2025-01-14T10:18:20.857Z","updated_at":"2026-06-12T09:31:18.023Z","avatar_url":"https://github.com/IanWold.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASP.NET Core Test Log Output\r\n\r\nThis repository gives a simple example as to how to test log output in an integration test for an ASP.NET Core API. It is a working example for my blog post [Testing Logging in ASP.NET Core](https://ian.wold.guru/Posts/testing_logging_in_asp_net_core.html), which gives a background and explanation of the code in this repository.\r\n\r\nThe `Api` project contains a simple API setup with one `/test` endpoint that logs an error level. The `Test` project contains an `ILoggerProvider` implementation to capture logs and expose them in a way that the tests can easily read. The single `Test.TestErrorLogged` test demonstrates how to inject the test logger into the host when setting up a `WebApplicationFactory`.\r\n\r\n## Running\r\n\r\nIn order to run, you'll need to ensure you have [the .NET 9 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) installed.\r\n\r\nTo run in Visual Studio, open the SLN, build, navigate to the Test Explorer, and execute the test.\r\n\r\nTo run in VS Code, I recommend installing the [C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit). With that extension, you can open the folder containing the project, build with dotnet, then navigate to the Testing view to execute the test.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwold%2Faspnetcoretestlogoutput","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianwold%2Faspnetcoretestlogoutput","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwold%2Faspnetcoretestlogoutput/lists"}