Biztalk Log4Net

Has anyone used log4net with Biztalk? We are currently studying its use and are trying to gain access to the pros / cons and regardless of whether they meet our needs.

+4
source share
3 answers

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 .

+8
source

Have you considered using ETW. This, in my opinion, is a way to go for the BizTalk tool. http://blogs.msdn.com/b/asgisv/archive/2010/05/11/best-practices-for-instrumenting-high-performance-biztalk-solutions.aspx

One of the drawbacks of using both log4net and Enterprise Logging is that you need to configure it to enable it. Therefore, you need to manage btsntsvc.exe.config files on all servers in your biztalk group, which can be overhead.

ETW is a zero configuration.

+3
source

I have to say that after using log4net and MS Enterprise Library to register applications in different projects, I prefer log4net. I especially like that with log4net you can centralize the configuration in one place (for example, in the database), instead of relying on the local app.config server for btsntsvc.exe.

This is especially useful if you need to twist new server instances to add to your farm - you have enough to not worry about logging configurations. I used log4net with both BTS2004 and BTS2006R2 and was satisfied. One thing that I would recommend no matter what logging infrastructure you use is falling into the trap of using the Event Log as a receiver - when you scale to 10 BTS application servers, the error tracking process takes a lot of time, especially the orchestration instances do not have similarities with the application server and usually move around your property! Keep an event log for important problems with the OS and BTS, and not because of user application errors - makes SCOM monitoring much less painless.

FYI - I also use log4net with the Colostock serializable shell, albeit with a few tweaks.

+2
source

Source: https://habr.com/ru/post/1306755/


All Articles