{"id":25778201,"url":"https://github.com/alandoherty/mezmo-logging-net","last_synced_at":"2025-06-17T12:36:51.127Z","repository":{"id":60300971,"uuid":"541707942","full_name":"alandoherty/mezmo-logging-net","owner":"alandoherty","description":"Mezmo backed provider for Microsoft.Extensions.Logging","archived":false,"fork":false,"pushed_at":"2022-09-27T19:11:30.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T12:56:19.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/alandoherty.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}},"created_at":"2022-09-26T17:35:32.000Z","updated_at":"2023-02-26T11:05:19.000Z","dependencies_parsed_at":"2022-09-27T20:41:17.434Z","dependency_job_id":null,"html_url":"https://github.com/alandoherty/mezmo-logging-net","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alandoherty/mezmo-logging-net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandoherty%2Fmezmo-logging-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandoherty%2Fmezmo-logging-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandoherty%2Fmezmo-logging-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandoherty%2Fmezmo-logging-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alandoherty","download_url":"https://codeload.github.com/alandoherty/mezmo-logging-net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandoherty%2Fmezmo-logging-net/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260359789,"owners_count":22997371,"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":"2025-02-27T06:29:57.948Z","updated_at":"2025-06-17T12:36:46.116Z","avatar_url":"https://github.com/alandoherty.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/alandoherty/mezmo-logging-net/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/alandoherty/mezmo-logging-net.svg?style=flat-square)](https://github.com/alandoherty/mezmo-logging-net/issues)\n[![GitHub stars](https://img.shields.io/github/stars/alandoherty/mezmo-logging-net.svg?style=flat-square)](https://github.com/alandoherty/mezmo-logging-net/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/alandoherty/mezmo-logging-net.svg?style=flat-square)](https://github.com/alandoherty/mezmo-logging-net/network)\n[![NuGet 1](https://img.shields.io/nuget/dt/Mezmo.Logging.svg?style=flat-square)](https://www.nuget.org/packages/Mezmo.Logging/)\n[![NuGet 2](https://img.shields.io/nuget/dt/Mezmo.Extensions.Logging.svg?style=flat-square)](https://www.nuget.org/packages/Mezmo.Extensions.Logging/)\n\n\u003c/div\u003e\n\n# mezmo-logging\n\nA library for ingesting logs into Mezmo (formerly LogDNA) on .NET 6.0 and greater. The library provides high performance logging, and focuses on reducing overheads such as allocations.\n\nBoth a lower level API `Mezmo.Logging.IngestClient` and a higher level `Microsoft.Extensions.Logging` provider are available. The lower level API will batch logs, the interval of batching can be configured on `IIngestClient.SendInterval`. Any exceptions which occur while sending logs will be printed in the debug output.\n\nYou should ensure that you call `IIngestClient.DisposeAsync` to flush any remaining logs before exiting your application. This will be done automatically by the application when using `Microsoft.Extensions.Hosting` and configuring the log provider properly.\n\n## Getting Started\n\n[![NuGet Status](https://img.shields.io/nuget/v/Mezmo.Extensions.Logging.svg?style=flat-square)](https://www.nuget.org/packages/Mezmo.Extensions.Logging/)\n\nYou can install the package using either the CLI:\n\n```\ndotnet add package Mezmo.Logging\nor\ndotnet add package Mezmo.Extensions.Logging\n```\n\nor from the NuGet package manager:\n\n```\nInstall-Package Mezmo.Logging\nor\nInstall-Package Mezmo.Extensions.Logging\n```\n\n### Example\n\nYou can find an example setup usable with any `Microsoft.Hosting.Extensions` based application, including `ASP.NET Core`. This will not automatically record request based information, see the Metadata section for how to send log metadata.\n\nYou can configure the example with a `Settings.json` file, or by using the following environment variables.\n\n| Name           | Example                          | Description                                     |\n|----------------|----------------------------------|-------------------------------------------------|\n| MEZMO__APIKEY  | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | Account ingestion key, required                 |\n| MEZMO__TAGS    | mytag1, mytag2                   | Tags to apply to all logs, optional             |\n| MEZMO__APPNAME | myapp                            | Application name to apply to all logs, optional |\n| MEZMO__URI     | https://logs.logdna.com          | Custom ingestion endpoint, optional             |\n\n### Metadata\n\nThe library supports recording metadata for the `Microsoft.Extensions.Logging` based logger. This is done using the scope system, see the `Example.Hosting` project for a hands on example. The scope state data will be serialized using `System.Text.Json.JsonSerializer`, you can pass a `string` directly to `ILogger.BeginScope` if you want to fully control the metadata formatting sent to Mezmo.\n\n```csharp\nclass MyData {\n    public string IpAddress { get; set; }\n    public string UserAgent { get; set; }\n}\n\nusing (logger.BeginScope(myData)) {\n    logger.LogInformation(\"Processing user request\");\n}\n```\n\n## Contributing\n\nAny pull requests or bug reports are welcome, please try and keep to the existing style conventions and comment any additions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falandoherty%2Fmezmo-logging-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falandoherty%2Fmezmo-logging-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falandoherty%2Fmezmo-logging-net/lists"}