ILog.CreateLog

Syntax

CreateLog;

Description

The CreateLog method creates a log in database on the basis of available metadata.

Example

Sub Main;

Var

Des: IMetabaseObjectDescriptor;

CrInf: IMetabaseObjectCreateInfo;

Mb: IMetabase;

MbObj: IMetabaseObject;

Log: ILog;

Begin

Mb:=MetabaseClass.Active;

CrInf := Mb.CreateCreateInfo;

CrInf.ClassId := MetabaseObjectClass.KE_CLASS_LOG;

CrInf.Id := "NewLog";

CrInf.Name := "NewLog";

CrInf.Parent := Mb.Root;

Des := Mb.CreateObject(CrInf);

MbObj:=Des.Edit;

Log:=MbObj.GetExtensionDispatch As ILog;

Log.Database:=Mb.ItemById("BD").Bind As IDatabase;

Log.NativeName:="NewLog";

MbObj.Save;

Log.DropLog;

Log.CreateLog;

End Sub Main;

After executing the example, the log in a database with the BD identifier is created. The log identifier is NewLog, a physical name of log is NewLog.

See also:

ILog