Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit d464e34

Browse files
stishkinstas
andauthored
fix tag shadowing (#3388)
Co-authored-by: stas <statis@microsoft.com>
1 parent c6b9147 commit d464e34

File tree

1 file changed

+8
-1
lines changed
  • src/ApiService/ApiService

1 file changed

+8
-1
lines changed

src/ApiService/ApiService/Log.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ private static SeverityLevel GetSeverityLevel(LogLevel logLevel) {
166166
/// <param name="eventId">Event Id information.</param>
167167
private void PopulateTelemetry<TState>(ISupportProperties telemetryItem, TState state, EventId eventId) {
168168
IDictionary<string, string> dict = telemetryItem.Properties;
169+
170+
PopulateTags(telemetryItem);
171+
169172
dict["CategoryName"] = this.categoryName;
170173
dict["Logger"] = nameof(OneFuzzLogger);
171174

@@ -181,11 +184,15 @@ private void PopulateTelemetry<TState>(ISupportProperties telemetryItem, TState
181184
if (string.Equals(item.Key, "{OriginalFormat}")) {
182185
dict["OriginalFormat"] = Convert.ToString(item.Value, CultureInfo.InvariantCulture) ?? $"Failed to convert {item.Value}";
183186
} else {
187+
//if there is an existing tag that is shadowing the log message tag - rename it
188+
if (dict.ContainsKey(item.Key)) {
189+
dict[$"!@#<--- {item.Key} --->#@!"] = dict[item.Key];
190+
}
184191
dict[item.Key] = Convert.ToString(item.Value, CultureInfo.InvariantCulture) ?? $"Failed to convert {item.Value}";
185192
}
186193
}
187194
}
188-
PopulateTags(telemetryItem);
195+
189196
}
190197

191198
/// <param name="telemetryItem"></param>

0 commit comments

Comments
 (0)