4 Replies Latest reply on Jun 30, 2015 8:58 PM by dng

    PI Web API Logging

    MikeRay

      Hi There,

       

      I have written some WCF services that get called by a third party application to send data to PI and within these web services I user the PI Web API to locate relevant elements in AF and write data to various attributes.

       

      I have had a problem in the last few days where the PI Web API 2015 service and the PI Web API 2015 Crawler service shut down unexpectedly. To try and understand why this happened I have been going through PI logs to try and find any log messages that may have been written by the PI Web API... but I cannot seem to locate any. I can't see configuration settings about logging or log level or anything in the documentation about logging.

       

      So my question is, is there anywhere I can go back and look to see if I can find any information about what was going on at the time the PI Web API service shut down?

       

      Thanks,

       

      Mike.

        • Re: PI Web API Logging
          lmlcoch

          Check the Event Logs (start > run > eventvwr).

           

          Windows Application Event Log and PI WebAPI Admin log (this one is under Applications and Services Logs) are very useful in these cases.

            • Re: PI Web API Logging
              dng

              Hi Michael,

               

              To add on to what Lubos pointed out, if you find that you are encountering this issue again, you can enable the analytic and debug logs for PIWebAPI to get more information. If you need some help troubleshooting the issue, I suggest contacting Tech Support. We might also request a crash dump to help determine the cause of the issue.

                • Re: PI Web API Logging
                  MikeRay

                  Thanks for the replies Lubos and Daphne.

                   

                  The problem I have is that the WCF service I wrote had some code to log my own information to the application event log so I can see what it was doing. I actually made it so that logging could be turned on or off on the fly, but this iteration I had a bug that meant it wouldn't turn off... so the net result was that after having a peek at the data coming into the services the logging never turned off and it kept on writing about 25 entries per second to the application event log and it filled right up and started overwriting old entries and I lost any entries from that time that may have helped me to diagnose why the Web API Service shut down

                   

                  Could excessive logging to the application event log by a calling program cause any misbehavior in the PI Web API?

                   

                  I was going to take it up with Tech Support however I don't think I have any other information I can provide them to help at this stage. I will however enable analytic and debug logs in case this happens again.

                   

                  Cheers,

                   

                  Mike.

                    • Re: PI Web API Logging
                      dng

                      Hi Michael,

                       

                      Is your application running on the same machine as PI Web API? If they are on separate machines, and your logging doesn't cause additional calls to be made to PI Web API, I don't see how it will affect PI Web API. If they are however on the same machine, or if the logging process makes additional requests to PI Web API, the issues could be related.

                       

                      Do note that the analytic and debug logs can generate a lot of events quickly, so it's advisable to turn them off if the issue doesn't happen again after a while.

                       

                      If this is still at the development server, perhaps you can also take the chance to upgrade to the latest version as we have just released PI Web API 2015 R2 (with AF SDK 2.7) that contains some important bug fixes.

                       

                      If PI Web API service shuts down unexpectedly again, please collect the dump files and event viewer logs and we will help troubleshoot the issue.