MigrationLogObj Object

Use the MigrationLogObj object to write log data to a data store determined by the connection string. The data includes the status of each migration.

Interface

The MigrationLogObj object supports the following interface:

interface IMigrationLog::IUnknown
{ 
    HRESULT Initialize([in] int nLogSuccess);
    HRESULT RecordInfo([in] LOGINFO lgInfo);
    HRESULT LogSuccess([in] BSTR bstrKeyName,
                       [in] long lprofile_id);
};

The IMigrationLog interface depends on the following structure:

typedef struct _LOGINFO
{
    long  lProfile_id
    BSTR  bstrDN;
    BSTR  bstrObject;
    Long  lErrorCode;
    BSTR  bstrReason;
} LOGINFO;

Methods

The following table shows the methods of the MigrationLogObj object, and provides a description for each.

Method Description
Initialize Initializes the MigrationLogObj object. Call this method before calling the RecordInfo or LogSuccess methods.
RecordInfo Use this method to record meaningful data to the log file.
LogSuccess This method is called when a successful migration occurs and the LogLevel registry key is 1 or 3. The success code is written to a file with a name constructed by concatenating the value of the LogFilePath registry key, the string "_success", and a number that is incremented as the file exceeds the "MaxNumLinesEachFile" registry key. An example file name is: C:\MigrationLog_success1.

Requirements

The following table contains the requirements of the MigrationLogObj object.

Parameter Description
Registry key SYSTEM\\CurrentControlSet\\Services\\Migration\\Parameters
LogFilePath The path of the log file. The default is "C:\MigrationLog". The data type is STRING.
MaxNumLinesEachFile The maximum number of lines in each log file. If the number of lines exceeds this number, another log file is created in the same directory. The data type is DWORD.
MaxNumThreads The maximum number of threads that run against the migration tool. The default value is four. The data type is DWORD.
AttributeFactors The number of entries in the mapping section for each attribute in an XML file. The type is DWORD. The default value is four, counting the following four lines:
<FromMembership>givenName</FromMembership>
<ToUPS>GeneralInfo.first_name</ToUPS>
<WProfileType>UserObject</WProfileType>
<WTypes>VT_BSTR</WTypes>

Each attribute in the mapping section contains these four lines, with different values.

ADsSearchPageSize Size of search page. The type is DWORD. See the Active Directory Service Interfaces (ADSI) documentation for more information.
MaxNumLinesEachFile The maximum number of lines in each log file. When this number is reached, a new log file is created in the same location with the file name extended with sequential numbers. The data type is DWORD.
NumberOfLinesToFlush Use this parameter to flush the memory when the log file contains the indicated number of lines. The data type is DWORD.
MaxAttributesFetched The number of attributes having values you request from the Membership Directory. A number that is too high may result in a time-out; a number that is too low will adversely affect performance. Do not set this value first.

Set this value to 50 if you receive a time-out error in the MigrationReadObj object. The data type is DWORD.

InitialWaitPeriod The time in milliseconds that the process sleeps for the first time. The default value is zero (0). It is recommended you set this to less than five (5). The data type is DWORD.
BackOffTimes The number of times to retry in case of failure. The default value is zero (0). It is recommended you set this to less than four (4). The data type is DWORD.
LogLevel Log level values are:

0 = Logs error only

1 = Logs error and success

2 = Logs error and performance

3 = Logs error and success and performance

The data type is DWORD.


All rights reserved.