File tree 4 files changed +14
-8
lines changed
Diagnostics/PostSharp.Samples.Logging.ElasticStack
4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 9
9
</PropertyGroup >
10
10
<Import Project =" Sdk.props" Sdk =" Microsoft.NET.Sdk" />
11
11
<ItemGroup >
12
- <PackageReference Include =" PostSharp.Patterns.Diagnostics.HttpClient" Version =" 6.8.4-preview" />
12
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics.HttpClient" Version =" 6.8.4-preview-58a97e " />
13
13
<PackageReference Include =" Serilog.Extensions.Logging" Version =" 3.0.1" />
14
14
<PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.1" />
15
- <PackageReference Include =" PostSharp.Patterns.Diagnostics" Version =" 6.8.4-preview" />
16
- <PackageReference Include =" PostSharp.Patterns.Diagnostics.Serilog" Version =" 6.8.4-preview" />
15
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics" Version =" 6.8.4-preview-58a97e " />
16
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics.Serilog" Version =" 6.8.4-preview-58a97e " />
17
17
<PackageReference Include =" Serilog.Sinks.ElasticSearch" Version =" 8.0.1" />
18
18
</ItemGroup >
19
19
<Import Project =" Sdk.targets" Sdk =" Microsoft.NET.Sdk" />
Original file line number Diff line number Diff line change 1
1
using PostSharp . Patterns . Diagnostics ;
2
2
using PostSharp . Patterns . Diagnostics . Adapters . HttpClient ;
3
3
using PostSharp . Patterns . Diagnostics . Backends . Serilog ;
4
+ using PostSharp . Patterns . Diagnostics . Correlation ;
4
5
using PostSharp . Patterns . Diagnostics . Custom ;
5
6
using PostSharp . Patterns . Diagnostics . RecordBuilders ;
6
7
using Serilog ;
@@ -50,7 +51,9 @@ private static async Task Main()
50
51
LoggingServices . DefaultBackend = backend ;
51
52
52
53
// Intercept outgoing HTTP requests and add logging to them.
53
- HttpClientLogging . Initialize ( uri => uri . Port != 9200 ) ;
54
+ HttpClientLogging . Initialize (
55
+ correlationProtocol : new LegacyHttpCorrelationProtocol ( ) ,
56
+ requestUriPredicate : uri => uri . Port != 9200 ) ;
54
57
55
58
56
59
using ( logSource . Debug . OpenActivity ( Formatted ( "Running the client" ) ,
Original file line number Diff line number Diff line change 14
14
<ItemGroup >
15
15
<PackageReference Include =" Serilog.AspNetCore" Version =" 3.2.0" />
16
16
<PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.1" />
17
- <PackageReference Include =" PostSharp.Patterns.Diagnostics" Version =" 6.8.4-preview" />
18
- <PackageReference Include =" PostSharp.Patterns.Diagnostics.Serilog" Version =" 6.8.4-preview" />
19
- <PackageReference Include =" PostSharp.Patterns.Diagnostics.AspNetCore" Version =" 6.8.4-preview" />
17
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics" Version =" 6.8.4-preview-58a97e " />
18
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics.Serilog" Version =" 6.8.4-preview-58a97e " />
19
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics.AspNetCore" Version =" 6.8.4-preview-58a97e " />
20
20
<PackageReference Include =" Serilog.Sinks.ElasticSearch" Version =" 8.0.1" />
21
21
</ItemGroup >
22
22
<ItemGroup >
Original file line number Diff line number Diff line change 5
5
using PostSharp . Patterns . Diagnostics ;
6
6
using PostSharp . Patterns . Diagnostics . Adapters . AspNetCore ;
7
7
using PostSharp . Patterns . Diagnostics . Backends . Serilog ;
8
+ using PostSharp . Patterns . Diagnostics . Correlation ;
8
9
using PostSharp . Patterns . Diagnostics . RecordBuilders ;
9
10
using Serilog ;
10
11
using Serilog . Sinks . Elasticsearch ;
@@ -55,7 +56,9 @@ public static void Main(string[] args)
55
56
56
57
57
58
// Instrument ASP.NET Core.
58
- AspNetCoreLogging . Initialize ( ) ;
59
+ AspNetCoreLogging . Initialize (
60
+ correlationProtocol : new LegacyHttpCorrelationProtocol ( )
61
+ ) ;
59
62
60
63
61
64
// Execute the web app.
You can’t perform that action at this time.
0 commit comments