File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
src/Serilog.Enrichers.Thread Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 15
15
using System . Threading ;
16
16
using Serilog . Core ;
17
17
using Serilog . Events ;
18
+ using System ;
18
19
19
20
namespace Serilog . Enrichers
20
21
{
21
22
/// <summary>
22
- /// Enriches log events with a ThreadId property containing the current <see cref="Thread.ManagedThreadId "/>.
23
+ /// Enriches log events with a ThreadId property containing the <see cref="Environment.CurrentManagedThreadId "/>.
23
24
/// </summary>
24
25
public class ThreadIdEnricher : ILogEventEnricher
25
26
{
@@ -35,7 +36,7 @@ public class ThreadIdEnricher : ILogEventEnricher
35
36
/// <param name="propertyFactory">Factory for creating new properties to add to the event.</param>
36
37
public void Enrich ( LogEvent logEvent , ILogEventPropertyFactory propertyFactory )
37
38
{
38
- logEvent . AddPropertyIfAbsent ( new LogEventProperty ( ThreadIdPropertyName , new ScalarValue ( Thread . CurrentThread . ManagedThreadId ) ) ) ;
39
+ logEvent . AddPropertyIfAbsent ( new LogEventProperty ( ThreadIdPropertyName , new ScalarValue ( Environment . CurrentManagedThreadId ) ) ) ;
39
40
}
40
41
}
41
42
}
Original file line number Diff line number Diff line change 21
21
namespace Serilog
22
22
{
23
23
/// <summary>
24
- /// Extends <see cref="LoggerConfiguration"/> to add enrichers for <see cref="Thread "/>.
24
+ /// Extends <see cref="LoggerConfiguration"/> to add enrichers for <see cref="Environment.CurrentManagedThreadId "/>.
25
25
/// capabilities.
26
26
/// </summary>
27
27
public static class ThreadLoggerConfigurationExtensions
28
28
{
29
29
/// <summary>
30
- /// Enrich log events with a ThreadId property containing the current <see cref="Thread.ManagedThreadId "/>.
30
+ /// Enrich log events with a ThreadId property containing the <see cref="Environment.CurrentManagedThreadId "/>.
31
31
/// </summary>
32
32
/// <param name="enrichmentConfiguration">Logger enrichment configuration.</param>
33
33
/// <returns>Configuration object allowing method chaining.</returns>
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 2.0.0-rc -*" ,
2
+ "version" : " 2.0.1 -*" ,
3
3
"description" : " Enrich Serilog events with properties from the current thread." ,
4
4
"authors" : [ " Serilog Contributors" ],
5
5
"packOptions" : {
9
9
"iconUrl" : " http://serilog.net/images/serilog-enricher-nuget.png"
10
10
},
11
11
"dependencies" : {
12
- "Serilog" : " 2.0.0-rc-577 "
12
+ "Serilog" : " 2.0.0"
13
13
},
14
14
"buildOptions" : {
15
15
"keyFile" : " ../../assets/Serilog.snk" ,
19
19
"frameworks" : {
20
20
"net4.5" : {
21
21
},
22
- "netstandard1.3 " : {
22
+ "netstandard1.0 " : {
23
23
"dependencies" : {
24
- "System.Threading.Thread" : " 4.0.0-rc2-24027"
25
24
}
26
25
}
27
26
}
You can’t perform that action at this time.
0 commit comments