public virtual void Format(LogEvent logEvent, TextWriter output) { var ecsEvent = LogEventConverter.ConvertToEcs(logEvent, _configuration); if (output is StreamWriter sw) ecsEvent.Serialize(sw.BaseStream); else { var bytes = ecsEvent.SerializeToUtf8Bytes(); output.Write(Encoding.UTF8.GetString(bytes)); } }
public virtual void Format(LogEvent logEvent, TextWriter output) { var ecsEvent = LogEventConverter.ConvertToEcs(logEvent, _configuration); output.WriteLine(ecsEvent.Serialize()); }