Logging Attribute Values
- Updated2025-07-23
- 2 minute(s) read
The default TestStand database schemas do not log attribute values that exist on result properties. The following examples demonstrate how you can customize a database schema in the Database Options dialog box to log attributes.
Logging a Specific Attribute to a Single Field
To log the value of a specifically-named attribute that can exist on a specific result property, retrieve the attribute value and store the value in a new field in a table.
For example, if the code modules stored optional, additional reason information in the attribute MyNameSpace.StatusReason on the Status property of steps, you can log the value of this attribute to a new field in the STEP_RESULT table by creating a new String column in the STEP_RESULT table and configuring the schema to include the following new column settings:
| Column Name | STATUS_REASON |
| Type | String |
| Size | 255 |
| Direction | Input (To DB) |
| Expected Properties | Logging.StepResult.Status.Attributes.MyNameSpace.StatusReason |
| Precondition | – |
| Expression | Logging.StepResult.Status.Attributes.MyNameSpace.StatusReason |
Logging Attributes for Properties
To log all attribute names and values for any property logged to the PROP_RESULT table, which includes most custom step properties and additional results, serialize the parent Attributes property for each result property and store the serialization to a new field in the PROP_RESULT table. For example, you can add a new string column, ATTRIBUTES, to the PROP_RESULT table and configure the schema to include the following new column settings:
| Column Name | ATTRIBUTES |
| Type | String |
| Size | 4096 |
| Direction | Input (To DB) |
| Expected Properties | – |
| Precondition | Logging.PropertyResult.HasAttributes |
| Expression | Logging.PropertyResult.Attributes.GetXML(0xF0F, 0) |