Home » Microsoft » 70-483 v.2 » Which code should you insert at line 28?
You have the following code (line numbers are included for reference only):
You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: C
Explanation/Reference:
* XmlWriterTraceListener
Directs tracing or debugging output as XML-encoded data to a TextWriter or to a Stream, such as a FileStream.
* TraceListener.TraceEvent Method (TraceEventCache, String, TraceEventType, Int32) Writes trace and event information to the listener specific output.
Syntax:
[ComVisibleAttribute(false)]
public virtual void TraceEvent(
TraceEventCache eventCache,
string source,
TraceEventType eventType,
int id
)
Correct “B”
I think answer is B.
Because, B logs ex.Message as “ApplicationData” in the log file. But, in C case, it is logged as source name, which logically may be not true.
B
…
Execution is too long > 5000 > 5011.9512
C
…
I think answer is B.
Because, B logs ex.Message as “ApplicationData” in the log file. But, in C case, it is logged as source name, which logically may be not true.
B
E2ETraceEvent xmlns=”http://schemas.microsoft.com/2004/06/E2ETraceEvent”
…
ApplicationData Execution is too long > 5000 > 5011.9512 ApplicationData
E2ETraceEvent
C
< E2ETraceEvent xmlns=”http://schemas.microsoft.com/2004/06/E2ETraceEvent” >
< System xmlns=”http://schemas.microsoft.com/2004/06/windows/eventlog/system” >
…
< Source Name=”Execution is too long > 5000 > 5011.0013″ />
< System >
< ApplicationData> ApplicationData />
< E2ETraceEvent>