Logging binary data and Tracing

Topics: Logging Application Block
Feb 23, 2010 at 2:37 PM

I am using EntLib 4.1- Logging Application Block in my application. I am facing following two problems,

1. I am using Formatted event log TraceListener and I want to log binary data in Data window of event viewer. I am using LogEntry as shown below,

                 LogEntry entry = new LogEntry();
                 entry.Severity = GetTraceEventType(t_level);                // GetTraceEventType is my method

                //Add logging category
                if (category != null)
                // Logs message if logging filter is enabled
                if (Logger.ShouldLog(entry))
                    if (message != null)
                        entry.Message = message.ToString();       // Add message to LogEntry

                    entry.TimeStamp = DateTime.Now;                 // Add time stamp to LogEntry                             


2. I want tracing in my application but supported levels are Error, Warning, Info... but not the tracing. How I should use EntLib for tracing. Whether "Verbose" is doing same thing?

Feb 24, 2010 at 3:53 AM


For tracing please see this : http://msdn.microsoft.com/en-us/library/dd203249.aspx and http://msdn.microsoft.com/en-us/library/dd203262.aspx . For the logging of binary data. Try using a binary formatter and associate it to your trace listener.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.