You can use the MessageLog and MessageLog2 interfaces in PI SDK to interact with the PI SDK Log. I will move this topic to Other OSIsoft Technologies for continued discussion. In particular, MessageLog.List should provide you with what you want and you can use the ProgramNameMask, msgStringMask, msgID to do your filtering
As Eugene mentioned, it's possible to read server log messages with PI SDK. The example can be found in pisdk.chm file located in the %pihome%\HELP directory. Just search for chapter MessageLog / LogMessages / LogMessage Example.
There is also a great example of retrieving messages using PI SDK and Poweshell here:Re: Powershell scripts for PI System maintenance
I hope what you suggested above is only allows to read the logs from only server machine. but actually my situation is different.
I have around 10 Interface nodes, seeing error something like "Unable to convert" for lot of tags in SDK Utility. So want to read all such logs from all different nodes such that it allows me process further.
So want to know how to read SDK logs at Interface node side.
What you are trying to do might not be possible with PI SDK as far as I know since you can only read remote server logs and not remote interface machine logs since they are accessed either by the PISDK or Server Classes MessageLog Property. There is no way to get a hold of the remote PISDK object. What you can do however could be to run the Command Line remotely using PSExec and use pigetmsg to get the messages on that node.
If your goal is to monitor interfaces for errors, there could be another approach: use the performance counters of the interface ( UnitInt provides a good set of counters, if you interface is not UniInt-based, you will have to look at your interface manual.)
You PI Interface Manual will tell you how those tags can be created.
The list if available counters is here:
And you are probably interested by these values:
- Points In Error
- Device Status
Once you have your tags in PI, you can monitor them very easily using PI Notifications, or AFSDK if you want to do some code.
Maybe this is not exactly what you want to do but I thought this is worth mentioning.
This scenario (remotely reading the SDK logs) is unimplemented for security reasons.
Quoting our developer "this was considered at one point, but it was decided that publishing services from possibly secure nodes was undesirable."
See the comment in this thread: Re: Retrieve SDK Message entries from a remote computer
And here is the Punch List Item for this issue: https://techsupport.osisoft.com/Troubleshooting/Enhancements/3492OSI8
For the suggestion above regarding the PSExec tool, please be extremely careful with using remote execution in production as it represents a security liability.
See also the articles below: