exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 54 discussion

Actual exam question from Microsoft's 70-483
Question #: 54
Topic #: 2
[All 70-483 Questions]

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 log 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
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
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");
}
References: http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.eventlogtracelistener

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Oziriz
Highly Voted 5 years, 10 months ago
Should be answer C!
upvoted 49 times
noussa
3 years, 11 months ago
It is C: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlogtracelistener?redirectedfrom=MSDN&view=dotnet-plat-ext-5.0
upvoted 3 times
...
...
dosper
Highly Voted 5 years, 4 months ago
C is the answer!
upvoted 7 times
...
DaGrooveNL
Most Recent 3 years, 10 months ago
FINAL ANSWER: C.
upvoted 2 times
...
scharpovna
3 years, 10 months ago
the explanation says: Trace.WriteLine("Test output"); and the same question #86 (on p.18) reveals Trace.WriteLine as correct answer.
upvoted 1 times
...
gjsdevs
4 years ago
This was discussed in stack overflow, in case anyone wants more info. As mewntioned here, it seems both A & C will log to event logs, but as this is in development I guess debug.writeLine should be the answer (A). https://stackoverflow.com/questions/56293717/writing-to-event-log-by-using-data-from-config-file
upvoted 1 times
...
lh2607
4 years, 5 months ago
C is right
upvoted 3 times
...
TonyBezerra
4 years, 9 months ago
I think C is the right answer.
upvoted 1 times
...
Sully_2020
4 years, 9 months ago
It’s definitely C! The explanation provided confirms it and references Trace.WriteLine(...).
upvoted 4 times
...
osaki
4 years, 11 months ago
I vote for A
upvoted 1 times
XXXX
4 years, 10 months ago
Its C... we are not debugging we are tracing look at the race tags in the above given code
upvoted 2 times
...
...
osaki
4 years, 11 months ago
EventLogTraceListener Class Provides a simple listener that directs tracing or debugging output to an EventLog. https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlogtracelistener?view=netframework-4.8
upvoted 1 times
...
Gods_Kenny
5 years ago
C is the answer
upvoted 1 times
...
dakuan
5 years, 1 month ago
C is correct.
upvoted 2 times
...
user123
5 years, 3 months ago
I think C is the right answer...
upvoted 4 times
...
supersunny
5 years, 4 months ago
A is right
upvoted 1 times
asdf652434
5 years, 2 months ago
I do not think so: Trace Listeners do not print Debug output.
upvoted 1 times
osaki
4 years, 11 months ago
it does, and I thinks A is the correct answer cause it says you are developping, it does not mention release or deployment so you need debug info only
upvoted 1 times
...
...
sadoki9311
4 years, 7 months ago
You failed me supersunny. There is nothing left in this world that I can trust.
upvoted 13 times
demoinq
4 years ago
Go ahead and trust me: it's C.
upvoted 2 times
...
AxleBl4Z3
3 years, 11 months ago
supersunny is always giving writing wrong answers... i have noticed at multiple places... he is just writing anything... Guys please dont take him seriously he is acting like a sad bitch
upvoted 4 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago