Skip to content

Commit 1dad962

Browse files
authored
Merge pull request #57 from datalust/dev
8.0.0 Release
2 parents e7fa4e0 + f8a7ccb commit 1dad962

File tree

82 files changed

+4226
-4375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+4226
-4375
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Seq.Extensions.Logging [![Build status](https://ci.appveyor.com/api/projects/status/h7r1hv3cpd6e2ou3?svg=true)](https://ci.appveyor.com/project/datalust/seq-extensions-logging) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Seq.Extensions.Logging.svg)](https://nuget.org/packages/Seq.Extensions.Logging) [![Join the chat at https://gitter.im/datalust/seq](https://img.shields.io/gitter/room/datalust/seq.svg)](https://gitter.im/datalust/seq)
1+
# Seq.Extensions.Logging [![Build status](https://ci.appveyor.com/api/projects/status/h7r1hv3cpd6e2ou3?svg=true)](https://ci.appveyor.com/project/datalust/seq-extensions-logging) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Seq.Extensions.Logging.svg)](https://nuget.org/packages/Seq.Extensions.Logging)
22

33
[Seq](https://datalust.co/seq) is a flexible self-hosted back-end for the ASP.NET Core logging subsystem (_Microsoft.Extensions.Logging_). Log events generated by the framework and application code are sent over HTTP to a Seq server, where the structured data associated with each event is used for powerful filtering, correlation, and analysis.
44

@@ -47,7 +47,7 @@ class HomeController : Controller
4747

4848
Log messages will be sent to Seq in batches and be visible in the Seq user interface. Observe that correlation identifiers added by the framework, like `RequestId`, are all exposed and fully-searchable in Seq.
4949

50-
### Logging with message templates~~~~
50+
### Logging with message templates
5151

5252
Seq supports the templated log messages used by _Microsoft.Extensions.Logging_. By writing events with _named format placeholders_, the data attached to the event preserves the individual property values.
5353

@@ -114,6 +114,18 @@ var json = "{\"A\": 42}";
114114
_logger.LogInformation("The answer is {Answer}", new JsonSafeString(json));
115115
```
116116

117+
### Trace and span correlation
118+
119+
The Seq logger provider automatically adds trace and span ids to events when present, enabling the _Trace_ drop-down menu in Seq's expanded event view.
120+
121+
ASP.NET Core may add additional top-level `TraceId`, `SpanId`, and `ParentId` properties in its default configuration. You can remove these if you wish, using `ILoggingBuilder.Configure()`:
122+
123+
```csharp
124+
builder.Logging.Configure(opts => {
125+
opts.ActivityTrackingOptions = ActivityTrackingOptions.None;
126+
});
127+
```
128+
117129
### Troubleshooting
118130

119131
> Nothing showed up, what can I do?
@@ -150,11 +162,13 @@ Seq.Extensions.Logging.SelfLog.Enable(message => {
150162
* Turn on the `SelfLog` as described above to check for connectivity problems and other issues on the client side.
151163
* [Raise an issue](https://github.com/datalust/seq-extensions-logging/issues), ask for help on the [Seq support forum](http://docs.datalust.co/discuss) or email **[email protected]**.
152164

153-
### Migrating to Serilog
165+
### Versioning policy
154166

155-
This package is based on a subset of the powerful [Serilog](https://serilog.net) library. Not all of the options supported by the Serilog and Seq client libraries are present in
156-
the _Seq.Extensions.Logging_ package. Migrating to the full Serilog API however is very easy:
167+
The major version of this package tracks the major version of its _Microsoft.Extensions.Logging_ dependency. So, if your
168+
application (on any target runtime) is targeting `net6.0`, use the latest 6.* version of this package. Likewise, if
169+
you're targeting `net8.0`, target a 8.* version of _Seq.Extensions.Logging_ for the best experience.
157170

158-
1. Install packages _Serilog_, _Serilog.Extensions.Logging_ and _Serilog.Sinks.Seq_.
159-
2. Follow the instructions [here](https://github.com/serilog/serilog-extensions-logging) to change `AddSeq()` into `AddSerilog()` with a `LoggerConfiguration` object passed in
160-
3. Add `WriteTo.Seq()` to the Serilog configuration as per [the example](https://github.com/serilog/serilog-sinks-seq) given for the Seq sink for Serilog
171+
### Credits
172+
173+
This package is based on a subset of the powerful [Serilog](https://serilog.net) library. Not all of the options supported by the Serilog and Seq client libraries are present in
174+
the _Seq.Extensions.Logging_ package.

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ version: '{build}'
22
skip_tags: true
33
image: Visual Studio 2022
44
build_script:
5-
- ps: ./Build.ps1
5+
- pwsh: ./Build.ps1
66
test: off
77
artifacts:
88
- path: artifacts/Seq.Extensions.Logging.*.nupkg
99
deploy:
1010
- provider: NuGet
1111
api_key:
12-
secure: 5aOb6I5NRP86KkV7nlAJmgyeuXXcrkWjZZZBPCZ7kAnw33ibgSMLdoGph3NMo0Xf
12+
secure: Urj/cvXeFTl4NjNLrRJUZ2EpSak7Jq9JfswqrNBeDpFiTjkpjzsm3CgoOr8gRSBU
1313
skip_symbols: true
1414
on:
1515
branch: /^(main|dev)$/

example/ConsoleExample/ConsoleExample.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

example/WebExample/Controllers/HomeController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace WebExample.Controllers;
66

77
public class HomeController : Controller
88
{
9-
private readonly ILogger<HomeController> _logger;
9+
readonly ILogger<HomeController> _logger;
1010

1111
public HomeController(ILogger<HomeController> logger)
1212
{
@@ -25,7 +25,7 @@ public IActionResult Index()
2525
{
2626
_logger.LogInformation("Events in this block have additional properties attached");
2727
}
28-
28+
2929
return View();
3030
}
3131

example/WebExample/Program.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
builder.Services.AddControllersWithViews();
55

66
// Use the Seq logging configuration in appsettings.json
7-
builder.Host.ConfigureLogging(loggingBuilder =>
8-
loggingBuilder.AddSeq());
7+
builder.Logging.AddSeq();
8+
9+
// Don't log redundant top-level `TraceId` and `SpanId` properties, these are handled implicitly
10+
// by the Seq logger.
11+
builder.Logging.Configure(opts => opts.ActivityTrackingOptions = ActivityTrackingOptions.None);
912

1013
var app = builder.Build();
1114

example/WebExample/Properties/launchSettings.json

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
@@ -10,4 +10,8 @@
1010
<ProjectReference Include="..\..\src\Seq.Extensions.Logging\Seq.Extensions.Logging.csproj" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<None Remove="Properties\launchSettings.json" />
15+
</ItemGroup>
16+
1317
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.300",
3+
"version": "8.0.100",
44
"rollForward": "latestFeature"
55
}
66
}

seq-extensions-logging.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
33
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
44
<s:Boolean x:Key="/Default/UserDictionary/Words/=Datalust/@EntryIndexedValue">True</s:Boolean>
5+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Destructurer/@EntryIndexedValue">True</s:Boolean>
56
<s:Boolean x:Key="/Default/UserDictionary/Words/=Enricher/@EntryIndexedValue">True</s:Boolean>
67
<s:Boolean x:Key="/Default/UserDictionary/Words/=Formattable/@EntryIndexedValue">True</s:Boolean>
78
<s:Boolean x:Key="/Default/UserDictionary/Words/=Serilog/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)