Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Device/Plugin developers can write audit events from within their own code by grabbing a handle to an AuditProvider. Assuming you have a message context, you can use the snippet below to write a record which will then be processed by the code above.

Code Block
languagec#
if (MessageChannel.AuditProvider?.IsPhiMessageFlowAuditingEnabled == true)
{
  var ar = context.CreatePhiAuditRecord(AuditAction.Device.SendMessage);
  ar.TargetUri = m_Client.RemoteEndPoint.ToString(); // if you are sending to an endpoint, set this. Can be file, network...
  MessageChannel.AuditProvider.AuditPhi(ar);
}