{"id":20904744,"url":"https://github.com/angelodotnet/serilogcustomextensions","last_synced_at":"2025-06-13T05:03:57.324Z","repository":{"id":135857825,"uuid":"612269083","full_name":"AngeloDotNet/SerilogCustomExtensions","owner":"AngeloDotNet","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-15T19:30:40.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T05:02:08.957Z","etag":null,"topics":["custom","extension","library","net6","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/AngeloDotNet.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":"2023-03-10T15:07:09.000Z","updated_at":"2024-03-27T18:54:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"0101b9b2-c7d3-474c-aa8e-28530b6bd522","html_url":"https://github.com/AngeloDotNet/SerilogCustomExtensions","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/AngeloDotNet/SerilogCustomExtensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FSerilogCustomExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FSerilogCustomExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FSerilogCustomExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FSerilogCustomExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngeloDotNet","download_url":"https://codeload.github.com/AngeloDotNet/SerilogCustomExtensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloDotNet%2FSerilogCustomExtensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259584749,"owners_count":22880194,"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":["custom","extension","library","net6","serilog"],"created_at":"2024-11-18T13:18:43.206Z","updated_at":"2025-06-13T05:03:57.208Z","avatar_url":"https://github.com/AngeloDotNet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serilog custom extensions\n\nIf you like this repository, please drop a :star: on Github!\n\n\n## Installation\n\nThe library is available on [NuGet](https://www.nuget.org/packages/SerilogCustomExtensions) or run the following command in the .NET CLI:\n\n```bash\ndotnet add package SerilogCustomExtensions\n```\n\n\n## Configuration to add to the appsettings.json file\n\n```json\n\"Serilog\": {\n  \"MinimumLevel\": \"Warning\",\n  \"WriteTo\": [\n    {\n      \"Name\": \"Console\",\n      \"Args\": {\n        \"outputTemplate\": \"{Timestamp:HH:mm:ss}\\t{Level:u3}\\t{SourceContext}\\t{Message}{NewLine}{Exception}\"\n      }\n    },\n    {\n      \"Name\": \"File\",\n      \"Args\": {\n        \"path\": \"Logs/log.txt\",\n        \"rollingInterval\": \"Day\",\n        \"retainedFileCountLimit\": 14,\n        \"restrictedToMinimumLevel\": \"Warning\",\n        \"formatter\": \"Serilog.Formatting.Json.JsonFormatter, Serilog\"\n      }\n    }\n  ]\n}\n```\n\n\n## Registering services at Startup\n\n```csharp\npublic Startup(IConfiguration configuration)\n{\n  Configuration = configuration;\n}\n\npublic IConfiguration Configuration { get; }\n\t\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddSerilogServices();\n}\n\n//OMISSIS\n\npublic void Configure(WebApplication app)\n{\n    app.AddSerilogConfigureServices();\n}\n```\n\n\n## Registering services at Program\n\n```csharp\npublic static void Main(string[] args)\n    {\n        WebApplicationBuilder builder = WebApplication.CreateBuilder(args);\n\n        builder.AddSerilogOptionsBuilder();\n\n        Startup startup = new(builder.Configuration);\n\n        //OMISSIS\n    }\n```\n\n\n## Example of use in a web api controller\n\n```csharp\n[ApiController]\n[Route(\"api/[controller]\")]\npublic class EmailController : ControllerBase\n{\n  private readonly ILoggerService loggerService;\n\n  public EmailController(ILoggerService loggerService)\n  {\n    this.loggerService = loggerService;\n  }\n  \n  //OMISSIS\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelodotnet%2Fserilogcustomextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangelodotnet%2Fserilogcustomextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelodotnet%2Fserilogcustomextensions/lists"}