-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
TracingUsage.cs
68 lines (49 loc) · 1.73 KB
/
TracingUsage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// ReSharper disable UnusedVariable
class TracingUsage
{
TracingUsage()
{
var tracingLog = SerilogTracingLogger();
var configuration = new EndpointConfiguration("EndpointName");
#region SerilogTracingPassLoggerToFeature
var serilogTracing = configuration.EnableSerilogTracing(tracingLog);
serilogTracing.EnableMessageTracing();
#endregion
}
static Serilog.Core.Logger SerilogTracingLogger()
{
#region SerilogTracingLogger
var configuration = new LoggerConfiguration();
configuration.Enrich.WithNsbExceptionDetails();
configuration.WriteTo.File("log.txt");
configuration.MinimumLevel.Information();
var tracingLog = configuration.CreateLogger();
#endregion
return tracingLog;
}
static void EnableSagaTracing(EndpointConfiguration configuration, ILogger logger)
{
#region EnableSagaTracing
var serilogTracing = configuration.EnableSerilogTracing(logger);
serilogTracing.EnableSagaTracing();
#endregion
}
static void EnableMessageTracing(EndpointConfiguration configuration, ILogger logger)
{
#region EnableMessageTracing
var serilogTracing = configuration.EnableSerilogTracing(logger);
serilogTracing.EnableMessageTracing();
#endregion
}
static void Seq()
{
#region SerilogTracingSeq
var configuration = new LoggerConfiguration();
configuration.Enrich.WithNsbExceptionDetails();
configuration.WriteTo.Seq("http://localhost:5341");
configuration.MinimumLevel.Information();
var tracingLog = configuration.CreateLogger();
#endregion
}
}
public class TheMessage;