private void AppendHeaderBytes(ByteArray buffer, LogEventInfo logEvent, Encoding encoding) { var timestamp = string.Format(CultureInfo.InvariantCulture, TimestampFormat, logEvent.TimeStamp); var host = hostnamePolicySet.Apply(hostnameLayout.Render(logEvent)); var header = $"{timestamp} {host}"; var headerBytes = encoding.GetBytes(header); buffer.Append(headerBytes); }
private void AppendHeader(ByteArray buffer, LogEventInfo logEvent) { if (!outputHeader) { return; } var timestamp = string.Format(CultureInfo.InvariantCulture, TimestampFormat, logEvent.TimeStamp); var host = hostnamePolicySet.Apply(hostnameLayout.Render(logEvent)); buffer.AppendAscii(timestamp); buffer.AppendBytes(SpaceBytes); buffer.AppendAscii(host); }