Skip to content

Commit aa23587

Browse files
authored
mod audit event info props extend with username (#2206)
1 parent cf700f9 commit aa23587

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Storage/Diagnostics/AuditEventInfo.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using SenseNet.Configuration;
2+
using System;
23
using System.Collections.Generic;
34
using System.Diagnostics;
45
using System.Linq;
@@ -49,6 +50,7 @@ public AuditEventInfo(IAuditEvent auditEvent, IDictionary<string, object> proper
4950

5051
var process = Process.GetCurrentProcess();
5152
var thread = Thread.CurrentThread;
53+
var props = Providers.Instance.PropertyCollector.Collect(properties);
5254

5355
_auditEvent = auditEvent;
5456
Timestamp = DateTime.UtcNow;
@@ -78,23 +80,23 @@ public AuditEventInfo(IAuditEvent auditEvent, IDictionary<string, object> proper
7880
sb.AppendFormat(" <Win32ThreadId>{0}</Win32ThreadId>", ThreadId).AppendLine();
7981
sb.AppendFormat(" <ThreadName>{0}</ThreadName>", ThreadName).AppendLine();
8082
sb.AppendFormat(" <ExtendedProperties>").AppendLine();
81-
foreach (var prop in properties)
83+
foreach (var prop in props)
8284
sb.AppendFormat(" <{0}>{1}</{0}>", prop.Key, formatValue(prop.Value)).AppendLine();
8385
sb.AppendFormat(" </ExtendedProperties>").AppendLine();
8486
sb.AppendFormat("</LogEntry>").AppendLine();
8587

8688
FormattedMessage = sb.ToString();
8789

88-
properties.TryGetValue("Category", out var category);
90+
props.TryGetValue("Category", out var category);
8991
Category = (string)category;
9092

91-
properties.TryGetValue("Id", out var id);
93+
props.TryGetValue("Id", out var id);
9294
ContentId = (int?)id ?? 0;
9395

94-
properties.TryGetValue("Path", out var path);
96+
props.TryGetValue("Path", out var path);
9597
ContentPath = (string)path;
9698

97-
properties.TryGetValue("UserName", out var userName);
99+
props.TryGetValue("UserName", out var userName);
98100
UserName = (string)userName;
99101
}
100102
}

0 commit comments

Comments
 (0)