I have a WCF service and I have read that it might be good to use Unity Interception to do logging. I want to log errors and also every request and response that comes into the WCF app into the database. So I plan to create a logging class that I can call from my LoggingInterceptionBehavior class. Is it best to make my new logging class a regular instance object and just new it up in the code below, or should I make it a singleton? Here is an example of my code setup:
class LoggingInterceptionBehavior : IInterceptionBehavior
{
public IMethodReturn Invoke(IMethodInvocation input,
GetNextInterceptionBehaviorDelegate getNext)
{
// Create a guid here to uniquely identify this call
// Save the request in some variable for logging
var result = getNext()(input, getNext);
//Call logging class here to log the request/response/error
return result;
}