I used Log4Net with BizTalk, but I will say that out of the box I ran into problems. Each call from BizTalk causes the current orchestration to become dehydrated (serialized), so any type that you use in BizTalk must be serializable, and log4net was not.
If you absolutely must use log4net, there is a shell that Scott Kostostok wrote here .
Assuming you are not blocked, I would just use Enterprise Logging, it offers almost the same functionality as log4net, and works out of the box with BizTalk. You can find it here .
Regarding the pros and cons, I will say that I offer almost exact functionality, in fact I created a program shell that made the Enterprise journal registration block look more like log4net.
public static class Logging { public static void LogMessage(TraceEventType eventType, string category, string message) { LogEntry logEntry = new LogEntry(); logEntry.Severity = eventType; logEntry.Priority = 1; logEntry.Categories.Add(category); logEntry.Message = message; Logger.Write(logEntry); } public static void LogError(string category, string message) { LogMessage(TraceEventType.Error, category,message); } public static void LogInfo(string category, string message) { LogMessage(TraceEventType.Information, category, message); } public static void LogVerbose(string category, string message) { LogMessage(TraceEventType.Verbose, category, message); } }
And if you need more look here .
source share