MaiOM
MaiOM

Reputation: 936

WCF Data Service - logging and authentication

I'm evaluating the WCF Data Service approach for my next project. As I would need to be flexible on logging and authentication I have a couple of questions that maybe you are able to answer.

1) Am I able to log different level of events, ex. warnings, errors, and redirect them to a different logging sources as database, text file, event log?

2) A link that shows how to perform the requested on question 1

3) Is there a way to introduce a simple authentication based on user name and password and how it is done?

4) Do you have by direct experience discovered any limitation on using Data Services instead of creating a WS-* WCF service for what concerns logging and authentication?

Thanks

Upvotes: 0

Views: 714

Answers (1)

Vitek Karas MSFT
Vitek Karas MSFT

Reputation: 13320

There's a good series of blogs about auth over OData service here: http://blogs.msdn.com/b/astoriateam/archive/tags/authentication/

For logging you should be able to use your web server's logging facilities (typically IIS I assume), since all errors are reported as error responses by the service.

You can also override the DataService.HandleException method and implement your own logging in any way you want. For logging of general non-error things there's also the processing pipeline (DataService.ProcessingPipeline). You can register a handler and implement your own logging of these as well. I don't know of a sample of this tough.

Upvotes: 3

Related Questions