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)
How can we enable tracing on the readymade tracing WCF objects?
Nice?
Vote!
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf
1 Answer
Nice?
Vote!
We will enable tracing on ‘System.ServiceModel’ tracing object. To enable tracing we need to enable the ‘system.diagnostics’ XML node in the ‘web.config’ file of the WCF service. We need to also define the type of listeners for the ‘System.ServiceModel’ listener object. So we add the ‘listeners’ tag with the type as ‘System.Diagnostics.XmlWriterTraceListener’. We need to also define the file and path where the file is created. For the current scenario we have defined the file as ‘Traces.svclog’ and the folder as ‘c:\’ drive.
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing">
<listeners>
<add name="log"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
Now if you run the WCF service you can see a XML file created as shown below.
#<E2ETraceEvent xmlns="
http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="
http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>0</EventID>
<Type>3</Type>
<SubType Name="Transfer">0</SubType>
<Level>255</Level>
<TimeCreated SystemTime="2009-04-30T03:21:09.5625000Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{d11829b7-d2db-46d5-a4ac-49a37a56376e}" />
<Execution ProcessName="WebDev.WebServer" ProcessID="2660" ThreadID="8" />
<Channel/>
<Computer>COMPAQ-JZP37MD0</Computer>
</System>
<ApplicationData></ApplicationData>
</E2ETraceEvent>
answered
1 year
ago
by
KrishnaMachiraju
(
7,980
points)
Related questions
Nice?
Vote!
1
answer
Where we can host WCF services?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf
Nice?
Vote!
1
answer
How do we host a WCF service in IIS?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
Ruban
(
360
points)
wcf
wcf-interview-questions
hosting
iis
Nice?
Vote!
1
answer
How to deal with operation overloading while exposing the WCF services?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf
Nice?
Vote!
1
answer
How to set the timeout property for the WCF Service client call?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf
Nice?
Vote!
1
answer
What is address in WCF and how many types of transport schemas are there in WCF?
asked
1 year
ago
in
.NET Interview Questions and Answers
by
KrishnaMachiraju
(
7,980
points)
wcf