OpenPlainLog: IPlainAuditLogRecords;
The OpenPlainLog method returns simplified method for displaying access protocol records in the linear format.
Add links to the Dal and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Log: IAuditLog;
LogRecords: IPlainAuditLogRecords;
i: Integer;
Lic: Object;
Begin
Mb := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
// Access protocol
Log := Mb.Security.OpenAuditLog;
LogRecords := Log.OpenPlainLog;
While (Not LogRecords.Eof) And (i <= 100) Do
If LogRecords.IsLogon Then
Debug.WriteLine("Log in to repository: " + LogRecords.Succeeded.ToString);
Debug.Indent;
Debug.Write("Operation time: " +
DateTime.FromDouble(LogRecords.Stamp).ToString + " - " +
DateTime.FromDouble(LogRecords.StampOut).ToString);
Debug.WriteLine("; Repository user: " + LogRecords.UserName +
"; Workstation: " + LogRecords.Station + '(' + LogRecords.UserIP + "); " +
"OS user: " + LogRecords.UserOS);
Debug.WriteLine("Comment: " + LogRecords.Comment);
Debug.Unindent;
Else
Debug.WriteLine("Operation: " + LogRecords.Name);
Debug.Indent;
Debug.WriteLine("Object: " + LogRecords.ObjectName + '(' + LogRecords.ObjectId +
"); Object class: " + LogRecords.ObjectClass.ToString);
Debug.Unindent;
End If;
i := i + 1;
LogRecords.Next;
End While;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the development environment console displays the 100 recent records from access protocol. Different information is displayed for operations with objects and repository connection records.
See also: