Serilog.Sinks.MySQL
6.1.0
dotnet add package Serilog.Sinks.MySQL --version 6.1.0
NuGet\Install-Package Serilog.Sinks.MySQL -Version 6.1.0
<PackageReference Include="Serilog.Sinks.MySQL" Version="6.1.0" />
<PackageVersion Include="Serilog.Sinks.MySQL" Version="6.1.0" />
<PackageReference Include="Serilog.Sinks.MySQL" />
paket add Serilog.Sinks.MySQL --version 6.1.0
#r "nuget: Serilog.Sinks.MySQL, 6.1.0"
#:package Serilog.Sinks.MySQL@6.1.0
#addin nuget:?package=Serilog.Sinks.MySQL&version=6.1.0
#tool nuget:?package=Serilog.Sinks.MySQL&version=6.1.0
Serilog.Sinks.MySQL
Serilog sink that writes to MySQL database.
Getting started
Install Serilog.Sinks.MySQL from NuGet
Install-Package Serilog.Sinks.MySQL
Configure logger by calling WriteTo.MySQL
var logger = new LoggerConfiguration()
.WriteTo.MySQL("server=127.0.0.1;uid=user;pwd=password;database=diagnostics;")
.CreateLogger();
logger.Information("This informational message will be written to MySQL database");
XML <appSettings> configuration
To use the rolling file sink with the Serilog.Settings.AppSettings package, first install that package if you haven't already done so:
Install-Package Serilog.Settings.AppSettings
In your code, call ReadFrom.AppSettings()
var logger = new LoggerConfiguration()
.ReadFrom.AppSettings()
.CreateLogger();
In your application's App.config or Web.config file, specify the MySQL sink assembly and required connectionString under the <appSettings> node:
<appSettings>
<add key="serilog:using:MySQL" value="Serilog.Sinks.MySQL"/>
<add key="serilog:write-to:MySQL.connectionString" value="..."/>
<add key="serilog:write-to:MySQL.tableName" value="Logs"/>
<add key="serilog:write-to:MySQL.storeTimestampInUtc" value="true"/>
</appSettings>
Note: This sink version 4.1 has breaking changes. It expects an additional column
Templateof type TemplateTEXTin log table. It is recommended to add this column manually or delete existing table so that it can be recreated correctly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- MySqlConnector (>= 2.5.0)
- Serilog (>= 4.3.1)
- System.Text.Json (>= 8.0.6)
-
net8.0
- MySqlConnector (>= 2.5.0)
- Serilog (>= 4.3.1)
NuGet packages (33)
Showing the top 5 NuGet packages that depend on Serilog.Sinks.MySQL:
| Package | Downloads |
|---|---|
|
RG3.PF.Web.StartUsed
1、【核心业务使用包RG3.PF.Web.StartUsed】(可配置化,标准化,灵活配置,集成百度、腾讯、阿里、短信通等巨头接口,可脱离开发环境,集成nodejs中间件、统一认证中心) 2、以Rg3.开头且类继承 IService 或 IRepository的在Starup里面不用注入,案例如下 3、public class ListRepository : IRepository 4、public class ListService : IService 5、使用请到github获取 RG3.PF.WebApp.Host 6、Quartz集成redis订阅、Quartz 7、修复多引用CLDC 8、接入微信公众号wxconfig 9、Prometheus+Grafana https://doc.rg1008.com/docs/rg_pass_log/rg_pass_log-1dpcuns9s6r8c 10、Headers添加VerifyApiValue 用于验证 11、添加时间戳 Convert.ToInt64(DateTimePFUtil.ToTimestampSecond(this.Expires)); 12、版本记录:https://doc.rg1008.com/docs/rg_pass_log/rg_pass_log-1dpubsabl25v4 13、 20240815 升级到.netcore sdk 8.0 |
|
|
SP.Common.Entity
Package Description |
|
|
CyberEye.Logging.Lib
Package chứa các thư viện, hàm tiện ích về Logs |
|
|
Gasco_C4C_CustomerEngagement
Package Description |
|
|
JuanLibrary
-Get Key Fixed.. If fail in Bearer the same input will be return. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Serilog.Sinks.MySQL:
| Repository | Stars |
|---|---|
|
serilog-contrib/serilog-ui
Simple Serilog log viewer UI for several sinks.
|
|
|
luoyunchong/dotnetcore-examples
about learning DotNetCore via examples. DotNetCore 教程、技术栈示例代码,快速简单上手教程。
|
| Version | Downloads | Last Updated |
|---|---|---|
| 6.1.0 | 60 | 5/30/2026 |
| 6.0.0-dev | 38 | 5/30/2026 |
| 5.0.0 | 415,587 | 6/8/2023 |
| 4.6.0 | 115,788 | 7/1/2022 |
| 4.5.0-dev-00044 | 33,179 | 3/19/2019 |
| 4.0.0 | 444,409 | 1/2/2019 |
| 4.0.0-dev-00039 | 1,165 | 10/13/2018 |
| 3.2.0-dev-00038 | 1,216 | 9/24/2018 |
| 2.7.5 | 24,827 | 1/18/2018 |
| 2.7.5-dev-00030 | 2,948 | 11/5/2017 |
| 2.7.5-dev-00029 | 1,661 | 9/24/2017 |
| 2.7.1 | 9,012 | 4/12/2017 |
| 2.7.0 | 1,847 | 4/5/2017 |
| 2.6.38 | 1,905 | 11/26/2016 |
| 2.5.1 | 2,151 | 10/22/2016 |