tags:

views:

100

answers:

1
+2  Q: 

Biztalk Log4Net

Has anyone used log4net with Biztalk? We are currently looking into using it and are trying to access pros/cons, and whether or not it would meet our needs.

+1  A: 

I have used Log4Net with BizTalk, but i will say that out of the box i ran into issues. Every call out of BizTalk results in the current orchestration getting dehydrated (serialized) so any type you use in BizTalk would have to be serializable and the log4net logger was not.

If you absolutely have to use log4net there is a wrapper that Scott Colestock wrote here.

Assuming you are not locked in, 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.

For pros and cons, i will say that offer almost exact functionality, I actually ended up creating a wrapper utility that made the Enterprise Library Logging 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 .

Nix
looking for more pros/cons
John Robbers