{"id":27860695,"url":"https://github.com/dotnetzoom/requestlogger-aspnetcore","last_synced_at":"2025-05-04T17:45:55.087Z","repository":{"id":41052252,"uuid":"279496445","full_name":"dotnetzoom/RequestLogger-AspNetCore","owner":"dotnetzoom","description":"Log Request and Response Details of your Actions in ASP.NET Core.","archived":false,"fork":false,"pushed_at":"2024-01-15T12:44:34.000Z","size":775,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-15T16:29:04.690Z","etag":null,"topics":["asp-net-core","aspnet-core","aspnetcore","logger","logging","request-logger","request-logging","requestlogger","requestlogging","response-logger","response-logging","serilog"],"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/dotnetzoom.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}},"created_at":"2020-07-14T05:59:32.000Z","updated_at":"2023-10-20T14:07:31.000Z","dependencies_parsed_at":"2023-02-12T01:15:56.950Z","dependency_job_id":null,"html_url":"https://github.com/dotnetzoom/RequestLogger-AspNetCore","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetzoom%2FRequestLogger-AspNetCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetzoom%2FRequestLogger-AspNetCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetzoom%2FRequestLogger-AspNetCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetzoom%2FRequestLogger-AspNetCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnetzoom","download_url":"https://codeload.github.com/dotnetzoom/RequestLogger-AspNetCore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252377080,"owners_count":21738166,"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-core","aspnet-core","aspnetcore","logger","logging","request-logger","request-logging","requestlogger","requestlogging","response-logger","response-logging","serilog"],"created_at":"2025-05-04T17:45:54.384Z","updated_at":"2025-05-04T17:45:55.081Z","avatar_url":"https://github.com/dotnetzoom.png","language":"C#","readme":"# RequestLogger\n\n    Log Request and Response Details of your Actions in ASP.NET Core.\n\n## Log Details\n\n- Execution date time (TimeStamp)\n- Execution duration (Elapsed)\n- Action Arguments (like your ViewModels)\n- ModelState (IsValid and Errors)\n- Request Path (Host and QueryString and RouteValues)\n- Request Method\n- Request Cookies\n- Request Headers\n- User.Identity (UserName and IsAuthenticated and Claims)\n- Response Cookies\n- Response Headers\n- Response StatusCode\n- IpAddress\n- UrlReferrer\n- Exception if thrown\n\n\u003e You can add your desired details like UserAgent info (such as browser, os, ... details) in `LogRequestAttribute.OnActionExecuting`\n\n## Usage\n\nJust put `[LogRequest]` attribute on your actions or register it globally\n\n```csharp\npublic class HomeController : Controller\n    {\n        public HomeController()\n        {\n        }\n\n        [LogRequest]\n        public IActionResult Index(MyViewModel myViewModel)\n        {\n            return View();\n        }\n\n        [LogRequest]\n        public IActionResult Privacy()\n        {\n            throw new Exception(\"test\");\n            return View();\n        }\n    }\n```\n\nCheck out [`Program.cs`](https://github.com/dotnetzoom/RequestLogger-AspNetCore/blob/master/RequestLogger/Program.cs) and [`Startup.cs`](https://github.com/dotnetzoom/RequestLogger-AspNetCore/blob/master/RequestLogger/Startup.cs) to see how to Configuration.\n\nThis uses [Serilog](https://github.com/serilog/serilog) and [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore) for logging and [MSSqlServer](https://github.com/serilog/serilog-sinks-mssqlserver) sink but you can use any other [Sinks](https://github.com/serilog/serilog/wiki/Provided-Sinks).\n\n## ScreenShot\n\n![Image](screenshot.jpg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnetzoom%2Frequestlogger-aspnetcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnetzoom%2Frequestlogger-aspnetcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnetzoom%2Frequestlogger-aspnetcore/lists"}