Example #1
0
        public void Emit(global::Serilog.Events.LogEvent logEvent)
        {
            if (_storage == null)
            {
                return;
            }
            if (logEvent == null)
            {
                return;
            }
            var key = Guid.NewGuid().ToString().Replace("-", string.Empty).ToUpper();

            //UpdateProperties(logEvent, key);
            //FilterProperties(logEvent);

            _storage.Upsert(key, new LogEvent
            {
                Key           = key,
                CorrelationId = GetCorrelationId(logEvent),
                Level         = logEvent.Level.ToString(),
                Message       = logEvent.RenderMessage(_formatProvider),
                Timestamp     = logEvent.Timestamp.DateTime,
                Properties    = GetProperties(logEvent)
            }, GetTags(logEvent), forceInsert: true, timestamp: logEvent.Timestamp.DateTime);
        }
Example #2
0
 public TDoc Store(TDoc document, IEnumerable <string> tags = null)
 {
     if (document == null)
     {
         return(default(TDoc));
     }
     _docStorage.Upsert(_key(document), document, EnsureTags(document, tags, _tagMap));
     return(document);
 }