Vetrivel mp
Vetrivel mp

Reputation: 1224

How to log error 500 in wcf applications

We all are know some time we will get 500 error while trying to hit wcf url. for example if pass string value to integer parameter it will throw 500 error as request error. my question is how to log, this kind error in some file? because this will not reach our actual end point class coding right? so how to log this error in some file? Any Help?

Upvotes: 0

Views: 582

Answers (2)

Neil Thompson
Neil Thompson

Reputation: 6425

I may very well be wrong here - but if the client is supplying the wrong parameters to a web method, that would be a 404 as no method matches the incoming request?

I would say it's the clients job to send the right data to the right function, and to handle failures appropriately (an EndPointNotFoundException perhaps)

Upvotes: 1

Marcin Hoppe
Marcin Hoppe

Reputation: 541

Assuming you want to log these on the server size, you should configure WCF tracing and use SvcTraceViewer to analyze the logs. More details on MSDN: http://msdn.microsoft.com/en-us/library/ms732023.aspx.

Upvotes: 3

Related Questions