What I am trying to do is pass multiple parameters to Log.Write without first creating a long string of them with newline escape characters.
Here is my current function:
public static void LogPipedEvent(string message)
{
//Split message on double pipe escape "||"
string newmessage = "";
string[] splitMessage = Regex.Split(message, Regex.Escape("||"));
foreach (string line in splitMessage)
{
newmessage += "\r\n" + line;
}
Logger.Write(newmessage, "DebugCategory", 2, 4000, TraceEventType.Information, "Message");
}
It works fine for what I need it to do but I am wondering if there is a cleaner way to break up the "message" portion of the log and have each entry get it's own line within Enterprise library?