Skip to content

Instantly share code, notes, and snippets.

@jonnii
Created November 26, 2012 23:42
Show Gist options
  • Save jonnii/4151400 to your computer and use it in GitHub Desktop.
Save jonnii/4151400 to your computer and use it in GitHub Desktop.
public class MessageHeader : IMessageHeader
{
public MessageHeader()
{
}
public MessageHeader(string message)
{
Body = message;
}
public DateTime TimeStamp { get; set; }
public string Conversation { get; set; }
public MessageLevel Level { get; set; }
public string LoggerName { get; set; }
public string Body { get; set; }
public int SequenceId { get; set; }
public string MachineName { get; set; }
public string CurrentUser { get; set; }
public int ProcessId { get; set; }
public string ProcessName { get; set; }
public ExceptionInfo Exception { get; set; }
public CustomAttribute[] CustomAttributes { get; set; }
public string Application { get; set; }
public string Environment { get; set; }
/// <summary>
/// Enlists the message header in the given conversation
/// </summary>
/// <param name="conversation">The conversation to enlist</param>
public void EnlistInConversation(IConversation conversation)
{
Conversation = conversation.Id;
}
public void SetCustomAttributes(CustomAttribute attribute, params CustomAttribute[] others)
{
var attributes = new[] { attribute };
CustomAttributes = attributes.Concat(others).ToArray();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment