示例#1
0
		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));
			}
		}
示例#2
0
        public virtual void Format(LogEvent logEvent, TextWriter output)
        {
            var ecsEvent = LogEventConverter.ConvertToEcs(logEvent, _configuration);

            output.WriteLine(ecsEvent.Serialize());
        }