exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 71 discussion

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

You are developing an application by using C#. The application will write events to an event log. You plan to deploy the application to a server.
You create an event source named MySource and a custom log named MyLog on the server.
You need to write events to the custom log.
Which code segment should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
afitz
Highly Voted 4 years, 11 months ago
Event source is "MySource" as stated in the question, answer must be D
upvoted 12 times
...
Codenoob
Highly Voted 4 years, 9 months ago
D is the correct answer. The sentence "You create an event source named MySource and a custom log named MyLog on the server." says it all. Which means that the MySource source and a custom log MyLog already exists in the Event Viewer of the server. if (!EventLog.SourceExists("MySource")) { EventLog.CreateEventSource("MySource", "MyNewLog"); Console.WriteLine("CreatedEventSource"); Console.WriteLine("Please restart application"); Console.ReadKey(); return; } EventLog myLog = new EventLog(); myLog.Source = "MySource"; myLog.WriteEntry("Log event!");
upvoted 8 times
...
DaGrooveNL
Most Recent 4 years, 3 months ago
FINAL ANSWER: D.
upvoted 1 times
...
lh2607
4 years, 10 months ago
Stupidly worded question - States Event Source is named "MySource" but we don't see an Event Source being named in any of the answers, however, we do see a Custom Event Log being created, which means that it has to be B or C as they both contain custom Event Logs that are called "MyLog" as stated in the question. Therefore, I'd go with C.
upvoted 4 times
...
WTH
5 years ago
B and D give error: Log property value has not been specified. A and C works.
upvoted 2 times
...
Milev
5 years, 1 month ago
how is this D?! i'd go for B..
upvoted 2 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