WBC66.Serilog.Core
2026.3.18
dotnet add package WBC66.Serilog.Core --version 2026.3.18
NuGet\Install-Package WBC66.Serilog.Core -Version 2026.3.18
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WBC66.Serilog.Core" Version="2026.3.18" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WBC66.Serilog.Core" Version="2026.3.18" />
<PackageReference Include="WBC66.Serilog.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WBC66.Serilog.Core --version 2026.3.18
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WBC66.Serilog.Core, 2026.3.18"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WBC66.Serilog.Core@2026.3.18
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WBC66.Serilog.Core&version=2026.3.18
#tool nuget:?package=WBC66.Serilog.Core&version=2026.3.18
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuget包合集
1. Serilog配置
线上nuget引入 版本号随时更新
<PackageReference Include="WBC66.Serilog.Core" Version="2026.03.08" />
1.1 Serilog配置文件
方式一(最简单直接引入,支持设置日志路径,忽略日志源,输出模板)
builder.Host.AddSerilogHost();
//里边三个参数可选 filePath, ignoredSources, outputTemplate,不设置就采用默认的
builder.Host.AddSerilogHost(filePath, ignoredSources, outputTemplate);
//添加DefaultIgnoredSources的静态方法,允许外部在不修改代码的情况下添加需要忽略的日志源(需要在AddSerilogHost之前调用)
SerilogHostBuilderExtensions.AddDefaultIgnoredSources("Microsoft.EntityFrameworkCore.Database.Command");
方式二(官方Json配置方式)
builder.Host.AddSerilogHostJson(configuration);
方式三(自定义Json配置方式)
"SerilogOptions": {
"MinimumLevel": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
},
"File": {
"Path": "Serilog/log-.txt",
"RollingInterval": "Day"
},
"Console": {
"Enabled": true,
"Minlevel": "Information",
"Template": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}"
},
"Elasticsearch": {
"Uri": "http://k8s.els.com",
"IndexFormat": "test-dev-{0:yyyy.MM.dd}",
"NumberOfShards": 2,
"NumberOfReplicas": 1,
"UserName": "elastic",
"Password": "changeme"
}
}
builder.Host.AddSerilogHost(configuration);
app.UseSerilogSetup();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Serilog.AspNetCore (>= 8.0.1)
- Serilog.Sinks.Async (>= 2.1.0)
- Serilog.Sinks.File (>= 7.0.0)
-
net7.0
- Serilog.AspNetCore (>= 8.0.1)
- Serilog.Sinks.Async (>= 2.1.0)
- Serilog.Sinks.File (>= 7.0.0)
-
net8.0
- Serilog.AspNetCore (>= 8.0.1)
- Serilog.Sinks.Async (>= 2.1.0)
- Serilog.Sinks.File (>= 7.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on WBC66.Serilog.Core:
| Package | Downloads |
|---|---|
|
WBC66.Core
WBC66.Core集合包 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.3.18 | 133 | 3/18/2026 |
| 2026.3.6 | 120 | 3/6/2026 |
| 2025.11.18 | 432 | 11/18/2025 |
| 2025.11.17 | 337 | 11/17/2025 |
| 2025.11.3 | 226 | 11/3/2025 |
| 2025.10.29 | 222 | 10/29/2025 |
| 2024.10.28 | 310 | 10/28/2024 |
| 2024.10.25 | 259 | 10/25/2024 |
基于serilog进行封装使用