{"id":47530335,"url":"https://github.com/voidnone/logging","last_synced_at":"2026-04-11T14:01:16.017Z","repository":{"id":98268201,"uuid":"89191490","full_name":"voidnone/logging","owner":"voidnone","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-20T16:50:57.000Z","size":498,"stargazers_count":32,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-21T06:12:07.978Z","etag":null,"topics":["asp-net-core","dotnetcore","logging"],"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/voidnone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-04-24T02:55:25.000Z","updated_at":"2026-03-20T16:51:01.000Z","dependencies_parsed_at":"2026-01-23T19:06:10.378Z","dependency_job_id":null,"html_url":"https://github.com/voidnone/logging","commit_stats":null,"previous_names":["huanent/huanent.logging","voidnone/dotnet-extensions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voidnone/logging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnone%2Flogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnone%2Flogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnone%2Flogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnone%2Flogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidnone","download_url":"https://codeload.github.com/voidnone/logging/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnone%2Flogging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31682953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","dotnetcore","logging"],"created_at":"2026-03-27T23:00:33.610Z","updated_at":"2026-04-11T14:01:16.009Z","avatar_url":"https://github.com/voidnone.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# VoidNone.Logging\n\nSimple logging providers for `Microsoft.Extensions.Logging`.\n\nThis repository currently contains two packages:\n\n- `VoidNone.Logging.Core`: plug in your own `ILogWriter`\n- `VoidNone.Logging.File`: write logs to files by log level and date\n\n## Install\n\n[![Nuget](https://img.shields.io/nuget/v/VoidNone.Logging.Core?label=core\u0026style=for-the-badge)](https://www.nuget.org/packages/VoidNone.Logging.Core/)\n[![Nuget](https://img.shields.io/nuget/v/VoidNone.Logging.File?label=file\u0026style=for-the-badge)](https://www.nuget.org/packages/VoidNone.Logging.File/)\n\n```bash\ndotnet add package VoidNone.Logging.Core\ndotnet add package VoidNone.Logging.File\n```\n\n## VoidNone.Logging.Core\n\nUse `VoidNone.Logging.Core` when you want to keep the standard logging API but send log entries to your own destination.\n\n### Custom writer\n\n```csharp\nusing VoidNone.Logging.Core;\n\npublic class CustomLogWriter : ILogWriter\n{\n    public void WriteLog(Log log)\n    {\n        Console.WriteLine($\"{log.Level} {log.Message} {log.Name} {log.Exception} {log.EventId}\");\n    }\n}\n```\n\n### Registration\n\n```csharp\nbuilder.Logging.ClearProviders();\nbuilder.Logging.AddImplementation\u003cCustomLogWriter\u003e();\n```\n\n### Filtering\n\n`VoidNone.Logging.Core` works with the standard `Logging` configuration model:\n\n```json\n{\n  \"Logging\": {\n    \"Implementation\": {\n      \"LogLevel\": {\n        \"Default\": \"Error\"\n      }\n    }\n  }\n}\n```\n\n## VoidNone.Logging.File\n\nUse `VoidNone.Logging.File` when you want logs written to disk under the application directory.\n\n### Registration\n\n```csharp\nbuilder.Logging.ClearProviders();\nbuilder.Logging.AddFile();\n```\n\nYou can also customize the file logger:\n\n```csharp\nbuilder.Logging.AddFile(options =\u003e\n{\n    options.Path = \"custom_log_folder\";\n    options.DateFormat = \"yyyyMMdd\";\n    options.RetentionDays = 90;\n});\n```\n\n### Options\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `Path` | `logs` | Base folder under `AppContext.BaseDirectory` |\n| `DateFormat` | `yyyyMMdd` | Date pattern used in the file name |\n| `RetentionDays` | `90` | Deletes files older than the configured number of days |\n\n### Output path\n\nLogs are written to:\n\n```text\n{application folder}/{Path}/{LogLevel}/{DateFormat}.log\n```\n\nWith the default options, an error log written on `2021-10-20` will be stored at:\n\n```text\n{application folder}/logs/Error/20211020.log\n```\n\n### Example output\n\n```text\n[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:35 +00:00]\nWorker running at: 10/20/2021 21:05:35 +08:00\nSystem.Exception: error\n\n[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:36 +00:00]\nWorker running at: 10/20/2021 21:05:36 +08:00\nSystem.Exception: error\n```\n\n### Filtering\n\n```json\n{\n  \"Logging\": {\n    \"File\": {\n      \"LogLevel\": {\n        \"Default\": \"Information\"\n      }\n    }\n  }\n}\n```\n\n## Samples\n\nSample applications are available under `samples/`:\n\n- `samples/Logging.CoreSample`\n- `samples/Logging.FileSample`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidnone%2Flogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidnone%2Flogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidnone%2Flogging/lists"}