![]() |
VOOZH | about |
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" />Directory.Packages.props
<PackageReference Include="Serilog.Sinks.MySQL" />Project file
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.0Install as a Cake Addin
#tool nuget:?package=Serilog.Sinks.MySQL&version=6.1.0Install as a Cake Tool
Serilog sink that writes to MySQL database.
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");
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 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
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. |
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 | 1,140 | 5/30/2026 |
| 6.0.0-dev | 93 | 5/30/2026 |
| 5.0.0 | 424,640 | 6/8/2023 |
| 4.6.0 | 116,480 | 7/1/2022 |
| 4.5.0-dev-00044 | 33,215 | 3/19/2019 |
| 4.0.0 | 445,950 | 1/2/2019 |
| 4.0.0-dev-00039 | 1,169 | 10/13/2018 |
| 3.2.0-dev-00038 | 1,219 | 9/24/2018 |
| 2.7.5 | 24,969 | 1/18/2018 |
| 2.7.5-dev-00030 | 2,951 | 11/5/2017 |
| 2.7.5-dev-00029 | 1,663 | 9/24/2017 |
| 2.7.1 | 9,033 | 4/12/2017 |
| 2.7.0 | 1,848 | 4/5/2017 |
| 2.6.38 | 1,907 | 11/26/2016 |
| 2.5.1 | 2,154 | 10/22/2016 |