Beispiel #1
0
        private IBasicProperties GetBasicProperties(AsyncLogEventInfo loggingEvent)
        {
            var @event = loggingEvent.LogEvent;

            return(new BasicProperties
            {
                ContentEncoding = "utf8",
                ContentType = _UseJSON ? "application/json" : "text/plain",
                AppId = AppId ?? @event.LoggerName,
                Timestamp = new AmqpTimestamp(MessageFormatter.GetEpochTimeStamp(@event)),
                UserId = UserName                         // support Validated User-ID (see http://www.rabbitmq.com/extensions.html)
            });
        }
Beispiel #2
0
 private byte[] GetMessage(AsyncLogEventInfo info)
 {
     return(_Encoding.GetBytes(MessageFormatter.GetMessageInner(_UseJSON, Layout, info.LogEvent, this.Fields)));
 }
Beispiel #3
0
        private byte[] GetMessage(AsyncLogEventInfo logEvent)
        {
            var msg = MessageFormatter.GetMessageInner(UseJSON, Layout, logEvent.LogEvent, Fields);

            return(_encoding.GetBytes(msg));
        }