Skip to content

vip32/serilog-sinks-litedb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ce3ed40 · Jun 18, 2024

History

69 Commits
Oct 31, 2016
Jun 13, 2024
Jun 13, 2024
Oct 31, 2016
Oct 31, 2016
Oct 31, 2016
Oct 31, 2016
Oct 31, 2016
Apr 24, 2020
Oct 31, 2016
Jun 13, 2024
Jun 13, 2024
Apr 24, 2020

Repository files navigation

Serilog.Sinks.LiteDB

NuGet

A Serilog sink that writes events as documents to LiteDB.

Package - Serilog.Sinks.LiteDB | Platforms - netstandard2.0, net6.0, net8.0

In the example shown, the sink will write to the database logs. The default collection name is log, but a custom collection can be supplied with the optional CollectionName parameter. The database and collection will be created if they do not exist.

// basic usage defaults to writing to `log` collection
var log = new LoggerConfiguration()
    .WriteTo.LiteDB(@"c:\tmp\logs.db")
    .CreateLogger();

// creates custom collection `applog`
var log = new LoggerConfiguration()
    .WriteTo.LiteDB(@"c:\tmp\logs.db", collectionName: "applog")
    .CreateLogger();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published