Tracing and logging exceptions in SOA RRS feed

  • Question

  • Note that N-Tier consists separate DLLs i.e., DAL.dll, BL.dll etc

    In N-Tier when an exception occurs in DAL (Data layer) and Service layer (WCF or ASP.NET Web API) calling the data layer any exception in data layer is NOT traced/caught by the Service layer. 

    when the exception occurs in DAL , service layer simply throws its own exception i.e., communication exception or similar.

    Query: Implementing Tracing and database logging in WCF (N-Tier) doesn't help to manage the service to quickly check database and resolve the issue, as the exception in DAL never been traced by the service layer. Please note that Enterprise Library: Logging app block is used with WCF, refer

    I think that it is required to implement tracing & logging for each layer, so that exception handling and trouble shooting is feasible.

    your insight and suggestion appreciated.

    Apriori algorithm [association rule]

    Monday, February 4, 2013 2:48 PM

All replies

  • Hi,

    Thanks for your post.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Best Regards.

    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 5, 2013 9:52 AM
  • Hi Sukumar,

    Hope that you are doing good today.

    Well, you would require tracing and logging as and when suited for your environment. By enabling tracing and logging this would just increase the amount of data and eat up more space on your machine. Only when you face any errors tracing will be a better. Yes, in your scenario, data logging and tracing at each layer will be a better way to go about to gather information as to what is happening. In case of an easily reproducible issue in case of network issues or packets being dropped issues capturing Network Monitor traces would be better option to see what is going on in the network. HTH.



    Monday, February 11, 2013 6:17 PM
  • Thanks Melissa.

    But your response is NOT answering my query completely.

    Let me elaborate:- In N-Tier architecture DAL (Assembly) is referenced in Service layer (lets say WCF or ASP.NET Web API) .

    When an exception is occurred in data layer the exception is over written with the service layer one. It can't be known until debug the application using Visual Studio. I have spent quite lot of time to utilise  Enterprise library: Database and logging application blocks to log exceptions to database that could help trouble shooting.  BUT the DAL exception is never traced or logged in database BECAUSE service layer exception simply wraps the DAL exception. Exception that is logged to database is copied below.

    Please inform how can the exception that occurred in DAL also logged ? Related thread on codeplex

    System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.get_Length()     at 
    Service.Implementation.ServiceRest.FromRequestStream(Stream inStream)     
    at Service.Implementation.ServiceRest.UpdateDoi(Stream inStream)     
    at SyncInvokeUpdateDoi(Object , Object[] , Object[] )     at 
    System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)     at 
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)     at 
    System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)     at 
    System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request,

    Apriori algorithm [association rule]

    Tuesday, February 12, 2013 10:49 AM
  • Your question falls into the paid support category which requires a more in-depth level of support. Please visit the below link to see the various paid support options that are available to better meet your needs.;en-us;offerprophone

    Monday, February 25, 2013 6:59 PM