Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Serilog sink that writes to MySQL database.

License

NotificationsYou must be signed in to change notification settings

mysql-net/serilog-sinks-mysql

 
 

Repository files navigation

Serilog sink that writes to MySQL database.

Getting started

InstallSerilog.Sinks.MySQL from NuGet

Install-Package Serilog.Sinks.MySQL

Configure logger by calling WriteTo.MySQL

varlogger=newLoggerConfiguration().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 configuration

To use the rolling file sink with theSerilog.Settings.AppSettings package, first install that package if you haven't already done so:

Install-Package Serilog.Settings.AppSettings

In your code, callReadFrom.AppSettings()

varlogger=newLoggerConfiguration().ReadFrom.AppSettings().CreateLogger();

In your application's App.config or Web.config file, specify the MySQL sink assembly and requiredconnectionString under the<appSettings> node:

<appSettings>    <addkey="serilog:using:MySQL"value="Serilog.Sinks.MySQL"/>    <addkey="serilog:write-to:MySQL.connectionString"value="..."/>    <addkey="serilog:write-to:MySQL.tableName"value="Logs"/>    <addkey="serilog:write-to:MySQL.storeTimestampInUtc"value="true"/></appSettings>

Performance

Sink buffers log messages internally and flush to MySQL database in batches using available hardware threads.

Build status

About

Serilog sink that writes to MySQL database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C#96.8%
  • PowerShell3.2%

[8]ページ先頭

©2009-2025 Movatter.jp