{"id":13604334,"url":"https://github.com/ravendb/serilog-sinks-ravendb","last_synced_at":"2025-04-09T16:15:32.065Z","repository":{"id":27698082,"uuid":"31184823","full_name":"ravendb/serilog-sinks-ravendb","owner":"ravendb","description":"A Serilog sink that writes events to RavenDB","archived":false,"fork":false,"pushed_at":"2024-02-20T11:53:47.000Z","size":77,"stargazers_count":17,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"dev","last_synced_at":"2025-04-09T16:15:12.962Z","etag":null,"topics":["ravendb","serilog"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ravendb.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-22T22:54:26.000Z","updated_at":"2024-03-19T02:16:44.000Z","dependencies_parsed_at":"2024-07-10T18:01:54.326Z","dependency_job_id":null,"html_url":"https://github.com/ravendb/serilog-sinks-ravendb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Fserilog-sinks-ravendb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Fserilog-sinks-ravendb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Fserilog-sinks-ravendb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Fserilog-sinks-ravendb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ravendb","download_url":"https://codeload.github.com/ravendb/serilog-sinks-ravendb/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065282,"owners_count":21041872,"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":["ravendb","serilog"],"created_at":"2024-08-01T19:00:43.729Z","updated_at":"2025-04-09T16:15:32.049Z","avatar_url":"https://github.com/ravendb.png","language":"C#","funding_links":[],"categories":["Logging and Auditing"],"sub_categories":[],"readme":"# Serilog.Sinks.RavenDB\n\n[![Build status](https://ci.appveyor.com/api/projects/status/maf8tidwq1xbvrqh/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-ravendb/branch/master) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.RavenDB.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.RavenDB/)\n\nA [Serilog](https://serilog.net) sink that writes events as documents to [RavenDB](http://ravendb.net).\n\n**Package** - [Serilog.Sinks.RavenDB](http://nuget.org/packages/serilog.sinks.ravendb)\n| **Platforms** - .NET Standard 2.0 (.NET 4.6.1 or later; .NET Core 2.0 or later)\n\n```csharp\nvar logs = new DocumentStore { ConnectionStringName = \"Logs\" }.Initialize();\n\nvar log = new LoggerConfiguration()\n    .WriteTo.RavenDB(logs)\n    .CreateLogger();\n```\n\nYou'll need to create a database on the server for logs, and specify this as your default database in the connection string or `DocumentStore.DefaultDatabase`.  In the alternative, you can pass a default database when configuring the RavenDB sink. [More information](http://nblumhardt.com/2013/06/serilog-and-ravendb/).\n\nYou can also configure the sink through your application config file using [Serilog.Settings.AppSettings](https://www.nuget.org/packages/Serilog.Settings.AppSettings)\n```csharp\nLog.Logger = new LoggerConfiguration()\n    .ReadFrom.AppSettings()\n    .CreateLogger();\n```\n```xml\n\u003cconnectionStrings\u003e\n  \u003cadd name=\"Logs\" connectionString=\"Url=http://[RAVEN_DB_SERVER]:8080/;DefaultDatabase=[OPTIONAL_DEFAULT_DATABASE]\" /\u003e\n\u003c/connectionStrings\u003e\n\u003cappSettings\u003e\n  \u003cadd key=\"serilog:minimum-level\" value=\"Information\" /\u003e\n  \u003cadd key=\"serilog:using:RavenDB\" value=\"Serilog.Sinks.RavenDB\" /\u003e\n  \u003cadd key=\"serilog:write-to:RavenDB.connectionStringName\" value=\"Logs\" /\u003e\n  \u003cadd key=\"serilog:write-to:RavenDB.defaultDatabase\" value=\"[DEFAULT_DATABASE]\" /\u003e\n\u003c/appSettings\u003e\n```\n\n### Automatic Log Record Expiration\n\nIf you install the RavenDB expiration bundle on the database where log records are stored, you can configure the\nsink to automatically delete log records. There are two ways to do this:\n* Simple version: passing `errorExpiration` (for fatal and error messages) and `expiration` (for all other messages). If you pass one, you should pass both. `Timeout.InfiniteTimeSpan` indicates that messages of the appropriate type will never be deleted by the expiration bundle.\n* Featured version: passing `logExpirationCallback`, a which will receive a Serilog `LogEvent` and return a `TimeSpan`. `Timeout.InfiniteTimeSpan` indicates that the message will never be deleted by the expiration bundle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravendb%2Fserilog-sinks-ravendb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravendb%2Fserilog-sinks-ravendb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravendb%2Fserilog-sinks-ravendb/lists"}