IMetabaseSecurity.LoadAuditLog

Syntax

LoadAuditLog(FileName: String): IAuditLog;

LoadAuditLog(System.String): Prognoz.Platform.Interop.Metabase.IAuditLog;

Parameters

FileName. A name and a way of the file that contains an archived access protocol.

Description

The LoadAuditLog method loads archived access protocol from file sent by the FileName parameter.

Comments

The method works with archived access protocols saved as the pplog file.

To archive file access protocol, use the IAuditLog.Archive method.

Example

Executing the example requires the C: drive the Log.pplog file in the root, containing the archived access protocol for the certain period.

Add the Metabase, ForeSystem (for the Fore.NET example) system assemblies.

Sub Main;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Log: IAuditLog;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Load access protocol from file
    Log := MS.LoadAuditLog("C:\Log.pplog");
    
// Display the number or records in protocol to the console
    Debug.WriteLine(Log.CountOperations);
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub Main;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Log: IAuditLog;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    
// Load access protocol from file
    Log := MS.LoadAuditLog("C:\Log.pplog");
    
// Display the number or records in protocol to the console
    System.Diagnostics.Debug.WriteLine(Log.CountOperations(UInteger.MaxValue, UInteger.MaxValue));
    
// Save changes
    MS.Apply();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example the archived access protocol is loaded from the file. The number of records, that the protocol contains, is displayed in the development environment console.

See also:

IMetabaseSecurity