Part 9 How to enable tracing and message logging in wcf

preview_player
Показать описание
Link for code samples used in the demo

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

Link for all dot net and sql server video tutorial playlists

Use Microsoft Service Configuration Editor to enable tracing and message logging in WCF. This can be done either on the client or the wcf service.

Enable Tracing and Message Logging in WCF
1. Right click on the config file and select "Edit WCF Configuration" option from the context menu. If you don't see this option, click on Tools menu item and then selecct WCF Configuration Editor and then point to the config file.
2. Select Diagnostics folder
3. Click on Enable Log Auto Flush link.
4. Then click on Enable Message Logging link. This should automatically add file, to which messages will be logged. To enable tracing click on Enable Tracing link.
5. Expand Diagnostics folder on the left hand side
6. Select Message Logging item that is present under Diagnostics folder. On the right hand side set LogEntireMessage option to true.
7. Close Microsoft Service Configuration Editor tool. This will ask you to Save Changes. Click Yes.

The config file should updated with the settings we have made using the tool. At this point we have enabled tracing and message logging.

Run the wcf service and the client. Make a request from the client. Look for the log files in the client or service folder depending on where you have enabled tracing and message logging.

To open the log files use Service Trace Viewer utility that ships with .NET. To open Service Trace Viewer utility, there are 2 options
1. Click on Start
2. Click All Programs.
3. Open Microsoft Visual Studio 2010 folder
4. Open Windows SDK Tools folder and then select Service Trace Viewer tool

Open Service Trace Viewer from visual studio command prompt
1. Open visual studio command prompt
2. Type SVCTRACEVIEWER and press enter

Point the Service Trace Viewer utility to the log file and you should see the messages exchanged between the service and the client.
Рекомендации по теме
Комментарии
Автор

After 6 years, a lot of YouTubers have come and gone. You are still one of the best. You have stood the test of time.

waynegreen
Автор

I have always configured service manually :D Great tutorial thanks again.

rikunjsuthar
Автор

I only wish everybody explained like that :)

ellie
Автор

thanks for your valuable contribution. 

shishirroy
Автор

Venkat can we except Mobile app development using C# in visual studio in future?



 

rajeshmca
Автор

Hi Venkat,

Amazing step by step articles on WCF. It is a fantastic tutorial for newbie like me. Thanks a lot.

Regarding Part 9, i am facing the following issue:

After making the necessary changes in the wcf configuration editor and when i ran the web application, i am getting the error "HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory."

But before the changes in the configuration editor, it was working fine. I don't know what went wrong

I tried several times but still i am getting the same error

Could you please help me out?

Regards,

RAJAN CRP

adapass
Автор

Why does it log the message on the client side! it seems more logical to me if it was on the service side. Can you please explain this issue. Thanks for the great work

LebanonJihad
Автор

And sir how to print asp.net textbox text values in pre-printed form your answer will help me lot

kiranpedamkar
Автор

I have an observation, I have Windows in Spanish, one of the configuration tags said: "Advertencia" and it should be "Warning". I corrected that and it started logging

garfiovargas
Автор

thnks, i am asking how can i put my web site on the net:how can every body see it

hichambouziane
Автор

Sir please help me, , I am using VS 2012 express where I am not having console app., , u always host the  services on console app. how can we host it on other asp.net web application?? plz tell

watan
Автор

how did i trace error before adding reference to client, what if error comes in adding webservice reference at first place?

vihar
Автор

sir how to jump on next text box on Enter button click

kiranpedamkar
Автор

trancing and message logging file cannot generated!!!! I use vs2019

hetfgh