What should you include in the application code?

You are developing an application that uses a .config file.
The relevant portion of the .config file is shown as follows:

You need to ensure that diagnostic data for the application writes to the event tog by using the
configuration specified in the .config file.
What should you include in the application code?

You are developing an application that uses a .config file.
The relevant portion of the .config file is shown as follows:

You need to ensure that diagnostic data for the application writes to the event tog by using the
configuration specified in the .config file.
What should you include in the application code?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Lord Vader

Lord Vader

D. trace.writeline:

the debug and trace classes have a Listeners collection that holds references to listener objects. to direct output to locations. add a trace listener object to the listeners collection. EventlogTraceListener: sends output to an event log.

The following example creates a trace listener that sends output to an event log. First, the code creates a new EventLogTraceListener that uses the source myEventLogSource. Next, myTraceListener is added to the Trace.Listeners collection. Finally, the example sends a line of output to the Listeners object.
public static void Main(string[] args) {

// Create a trace listener for the event log.
EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”);

// Add the event log trace listener to the collection.
Trace.Listeners.Add(myTraceListener);

// Write output to the event log.
Trace.WriteLine(“Test output”);
}