kkolli

PIMessageLogTraceListener (Writing message to server)

Discussion created by kkolli on Jun 17, 2014
Latest reply on Jun 17, 2014 by Mike Zboray
Hello, I am trying to write messages to the server log. I would like to do this with the AF SDK. with the PI SDK this is how I accomplished it:             PISDK.PISDK pisdk = new PISDK.PISDK();             Server piServer = pisdk.Servers["MyServer"];             MessageLog log = piServer.MessageLog;             log.PutString("some message"); With the AF SDK I have found OSIsoft.AF.Diagnostics.PIMessageLogTraceListener but the results only go to the local log. I have tried this:             OSIsoft.AF.Diagnostics.PIMessageLogTraceListener tl = new OSIsoft.AF.Diagnostics.PIMessageLogTraceListener();                        tl.WriteLine("some message"); Any advice would be appreciated as to how I might use PIMessageLogTraceListener in order to write log messages to the server.

Outcomes