Created
November 26, 2012 23:42
-
-
Save jonnii/4151400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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