/// <summary> /// Populates RabbitMQ header properties with the current MessageHeader /// </summary> /// <param name="headers"></param> public void Populate(IDictionary <string, object> headers) { headers.Add("MessageGuid", MessageGuid.ToString()); headers.Add("ProducerProcessID", ProducerProcessID); headers.Add("ProducerExecutableName", ProducerExecutableName); headers.Add("OriginalPublishTimestamp", OriginalPublishTimestamp); headers.Add("Parents", string.Join(Splitter, Parents)); }
public void Log(ILogger logger, LogLevel level, string message, Exception ex = null) { //TODO This is massively over-logging - ProducerProcessID, ProducerExecutableName, OriginalPublishTimestamp are found in the logs anyway var theEvent = new LogEventInfo(level, logger.Name, message); theEvent.Properties["MessageGuid"] = MessageGuid.ToString(); theEvent.Properties["ProducerProcessID"] = ProducerProcessID; theEvent.Properties["ProducerExecutableName"] = ProducerExecutableName; theEvent.Properties["OriginalPublishTimestamp"] = OriginalPublishTimestamp; theEvent.Properties["Parents"] = string.Join(Splitter, Parents); theEvent.Exception = ex; logger.Log(theEvent); }