예제 #1
0
        public void Append(ByteArray message, LogEventInfo logEvent)
        {
            var sdFromEvtProps = fromEventProperties.Render(logEvent);

            if (!string.IsNullOrEmpty(sdFromEvtProps))
            {
                message.AppendUtf8(sdFromEvtProps);
                return;
            }

            if (sdElements.Count == 0)
            {
                message.AppendBytes(NilValueBytes);
            }
            else
            {
                SdElement.Append(message, sdElements, logEvent);
            }
        }
예제 #2
0
        public void AppendBytes(ByteArray message, LogEventInfo logEvent, EncodingSet encodings)
        {
            var sdFromEvtProps = fromEventProperties.Render(logEvent);

            if (!string.IsNullOrEmpty(sdFromEvtProps))
            {
                var sdBytes = encodings.Utf8.GetBytes(sdFromEvtProps);
                message.Append(sdBytes);
                return;
            }

            if (sdElements.Count == 0)
            {
                message.Append(NilValueBytes);
            }
            else
            {
                SdElement.AppendBytes(message, sdElements, logEvent, encodings);
            }
        }
예제 #3
0
 public override string ToString()
 {
     return(sdElements.Count == 0 ? NilValue : SdElement.ToString(sdElements));
 }