# Excluded Record Logging

As source records are processed some may be excluded, either because they do not match one of the target tables, or because there was an error of some kind when processing them.

This tab enables you to record information about the excluded records in a table in the source database or the target database.

NOTE: The table must be created before you can log to it.

Click Enable to enable logging.

### Connector to Use

You need to select whether the log table is in the source or target database.

### Log Table Setup

Select the log table from the drop down, then select the primary key field for the table.

You can specify that the table is cleared at the start of the run, or that new log records are appended to the end of it.

### Log Table Mapping

In the grid, specify which fields in the source record will be written to the log table. In general, you will want to make sure that the primary key or some unique record identifier is logged, so that you can use the log table to select the source records with a SQL join statement.

You may also map an expression to the log table.

NOTE: three virtual fields are added to the source record for mapping purposes, which provide information about why the record was excluded. The virtual fields

Virtual Field | Data Type | Meaning
--- | --- | ---
vf_RecordNumber | Integer | Source record number - 1 origin
vf_ErrorCode | Integer | Numeric code indicating why record was excluded
vf_ErrorMessage | String | Error message text - will include table name if match fail, or full error message if data error

The error codes are:

Error Code | Meaning
--- | ---
10 | Data error when processing record
20 | Record filtered by expression in filter grid (tab 2)
30 | No match - record did not match nay records in target table
40 | Multiple match - record matched too many records in target