Skip to content

Commit

Permalink
EcsEvent: Tags - changed from array to IList<string>
Browse files Browse the repository at this point in the history
  • Loading branch information
mrapavy committed Oct 20, 2023
1 parent b467bb8 commit 0f5a2b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/SerilogEcsLogging/Logging/EcsEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class EcsEvent : IEcsEvent

public string EventKind { get; }

public string[]? Tags { get; }
public IList<string>? Tags { get; }

public bool? EventOutcome { get; set; }

Expand All @@ -20,7 +20,7 @@ public class EcsEvent : IEcsEvent

public string? TraceId { get; set; }

public EcsEvent(string eventAction, string eventKind = Elastic.CommonSchema.EventKind.Event, string[]? tags = null, bool? eventOutcome = null, TimeSpan? eventDuration = null, string? message = null, object? eventData = null, string? transactionId = null, string? traceId = null)
public EcsEvent(string eventAction, string eventKind = Elastic.CommonSchema.EventKind.Event, IList<string>? tags = null, bool? eventOutcome = null, TimeSpan? eventDuration = null, string? message = null, object? eventData = null, string? transactionId = null, string? traceId = null)
{
EventAction = eventAction;
EventKind = eventKind;
Expand Down
2 changes: 1 addition & 1 deletion src/SerilogEcsLogging/Logging/IEcsEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public interface IEcsEvent

string EventKind { get; }

string[]? Tags { get; }
IList<string>? Tags { get; }

bool? EventOutcome { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/SerilogEcsLogging/Logging/LoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void LogEvent(this ILogger logger, LogLevel logLevel, Exception? e
outcome = Elastic.CommonSchema.EventOutcome.Failure;
}

using (logger.BeginScope($"{{{LogFilename}}} {{{LogLineNumber}}} {{{LogMethodName}}} {{{EventActionSeverity}}} {{{EventActionName}}} {{{EventActionKind}}} {{{EventDuration}}} {{{EventOutcome}}} {{{EventStart}}} {{@{EventData}}} {{@{Tags}}}", sourceFilePath, sourceLineNumber, memberName, LogLevel.None - logLevel, ecsEvent.EventAction, ecsEvent.EventKind, ecsEvent.EventDuration, outcome, eventStart, ecsEvent.EventData, ecsEvent.Tags?.ToList()))
using (logger.BeginScope($"{{{LogFilename}}} {{{LogLineNumber}}} {{{LogMethodName}}} {{{EventActionSeverity}}} {{{EventActionName}}} {{{EventActionKind}}} {{{EventDuration}}} {{{EventOutcome}}} {{{EventStart}}} {{@{EventData}}} {{@{Tags}}}", sourceFilePath, sourceLineNumber, memberName, LogLevel.None - logLevel, ecsEvent.EventAction, ecsEvent.EventKind, ecsEvent.EventDuration, outcome, eventStart, ecsEvent.EventData, ecsEvent.Tags))
{
logger.Log(logLevel, exception, ecsEvent.EventMessage);
}
Expand Down

0 comments on commit 0f5a2b4

Please sign in to comment.