WCF RESTful service Grouping logs as execution goes through different classes and assemblies RRS feed

  • Question

  • We have a set of RESTful services running on IIS. Since this is a new application, we want to monitor how it does things and have the need to log data as the call moves through the different classes and assemblies. Having the concurrency mode = Multiple, it makes it hard to group the logs by a "thread".

    Does anyone have any ideas on how we can identify different logs by a specific value without passing in the value along all calls?

    I was wondering if there is perhaps a global system variable value that remains the same throughout the whole execution thread across multiple assemblies and we can perhaps add that value to the logs so we can group them and see the whole process by sorting by the date\time the log was written.

    Another possible way is perhaps using an OO solution. Perhaps all the classes need to inherit from ILog for example which will generate the unique value, but I'm not sure how this can be done.



    Tuesday, June 16, 2015 3:54 PM

All replies

  • Hi Alex,
       As per this case, you can use standard tracing and diagnostic tool for WCF, and work with .svclogs using SvcTraceViewer.exe application.

    For your case,services running on IIS,so you can use AppFabric. It a great tool, when you can easily manage the settings of your services, including tracing and diagnostic. Click here to refer about it.

    The AppFabric Dashboard provides a centralized gateway to view and manage the health of WF and WCF services deployed locally or to a server farm. It exposes real-time data from the Persistence database and historic data from the Monitoring database, and it allows you to “drill down” to examine instance and WCF Call metrics in greater detail. Click here to refer about it.

    AppFabric helps to monitor WCF service like How many time the operation is invoked, Errors/ Faults and also supports historical data.

    Wednesday, June 17, 2015 3:21 AM
  • Thanks Edwin. Both these solutions will take some time to implement, but I will definately try them out in our test environment.

    But they don't provide the details we are trying to log. For example, UserA creates a ticket. We need to log the data that was sent in. We also want to log the "calculated" data we set before creating the ticket. In between, we call other classes that perform neccessary functions for the ticket creation.

    Now we have UserB doing the same thing at the same time. For some reason, UserB's request failed, so we want to see the following in our log table:

    Call#1, UserA, CreateTicket, data

    Call#1, UserA, GetUserDetails, data

    Call#2, UserB, CreateTicket, data

    Call#2, UserB, CreateTicket, data

    Call#1, UserA, CreateTicket Error=, data

    Now we can select the records and group them by Call# so we see how UserA's execution stack goes through the process

    Wednesday, June 17, 2015 4:26 PM