Login
Register
All Activity
Questions
Unanswered
Tags
Users
Ask a Question
About Us
986
Questions
785
Answers
Interview Preparation mode
beta
Funny Facebook Status
Enter your email address
All categories
SQL Server Interview Questions and Answers
(197)
SSIS Interview Questions and Answers
(54)
SSRS Interview Questions and Answers
(9)
SSAS Interview Questions and Answers
(29)
.NET Interview Questions and Answers
(186)
Oracle Interview Questions and Answers
(122)
Java Interview Questions and Answers
(32)
UNIX Interview Questions and Answers
(47)
Networking Interview Questions and Answers
(17)
MySQL Interview Questions and Answers
(30)
HR Interview Questions and Answers
(237)
General Interview Questions and Answers
(9)
Other Interview Questions and Answers
(8)
Job Openings
(3)
Greenplum Database Interview Questions and Answers
(5)
Can you explain the concept of trace listener?
Nice?
Vote!
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf
1 Answer
Nice?
Vote!
‘Tracelistener’ are objects that get tracing information from the trace class and they output the data to some medium. For instance you can see from the figure ‘TraceListener’ how it listens to the trace object and outputs the same to UI, File or a windows event log. There are three different types of ‘tracelistener’ first is the ‘defaulttracelistener’ (this outputs the data to UI), second is ‘textwritertracelistener’ (this outputs to a file) and the final one is ‘Eventlogtracelistener’ which outputs the same to a windows event log.
Below is a code snippet for ‘textwritertracelistener’ and ‘eventlogtracelistener’. Using ‘textwritertracelistener’ we have forwarded the trace’s to ‘ErrorLog.txt’ file and in the second snippet we have used the ‘Eventlogtracelistener’ to forward the trace’s to windows event log.
answered
1 year
ago
by
KrishnaMachiraju
(
7,980
points)
Related questions
Nice?
Vote!
1
answer
How can we enable tracing on the readymade tracing WCF objects?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf
Nice?
Vote!
1
answer
What are the advantages of hosting WCF Services in IIS as compared to self-hosting?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
Anand
(
1,440
points)
wcf
wcf-interview-questions
hosting
iis
Nice?
Vote!
1
answer
what are the various ways of hosting a WCF service?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
Boni
(
860
points)
wcf
wcf-interview-questions
hosting
Nice?
Vote!
1
answer
What are the main components of WCF?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
Karan
(
240
points)
wcf
wcf-interview-questions
components
Nice?
Vote!
1
answer
What are the important principles of SOA (Service oriented Architecture)?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
Pandi
(
540
points)
wcf
wcf-interview-questions
soa
service-oriented-architecture