---
title: AuditInfoStruct
summary: API reference for AuditInfoStruct.
status: draft
owner: <owner>
last_reviewed: 2026-07-23
library: SAIF.Framework.Logging
reference_type: package
---

# AuditInfoStruct

`AuditInfoStruct` is a `Serializable` value type used to pass audit-log context and message data between [clsLogAudit](clsLogAudit.md), the local CSV file sink, and the remote `wsLogging` SOAP web service.

## Purpose
- Carry ambient context (application name, machine name, environment, page name, username) and message content (`MessageText`, `DataText`) for a single audit-log record.
- Provide a CSV serialization format (`CSVHeader`/`ToCSVString`) used when `clsLogAudit.ToFile()` has redirected writes to a local file sink.

## Context
- Namespace: `SAIF.Framework.Logging`
- Assembly/package: `SAIF.BOF.Framework.Logging` (`SAIF.Framework.Logging/SAIF.BOF.Framework.Logging.vbproj`)
- Declared `<Serializable()> Public Structure AuditInfoStruct`, allowing it to be marshalled to the `wsLogging` SOAP web service.

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `ApplicationName` | `Public ApplicationName As String` | Name of the hosting application that produced the audit event. |
| `AuditDate` | `Public AuditDate As DateTime` | Timestamp of the audit event. |
| `DataText` | `Public DataText As String` | Caller-supplied data payload rendered to text, for custom audit messages. |
| `Environment` | `Public Environment As String` | Deployment environment name derived for the hosting application. |
| `MachineName` | `Public MachineName As String` | Name of the machine on which the audit event occurred. |
| `MessageText` | `Public MessageText As String` | Primary audit message text. |
| `PageName` | `Public PageName As String` | Name of the page (web) or calling context associated with the event. |
| `UserName` | `Public UserName As String` | Name of the current user associated with the event. |
| `CSVHeader` | `Public Shared Function CSVHeader() As String` | Returns the fixed CSV column-header row used by the local file sink. |
| `ToCSVString` | `Public Function ToCSVString() As String` | Renders the struct's field values as a single CSV row. |

## Behavioral notes
- Populated by `clsLogAudit`'s private `GetBasicAuditInfo()`/context-gathering logic before being passed to `WriteMessage` for dispatch*.
- Marshalled as-is to the `wsLogging.clsWSLogging.WriteAudit` SOAP operation when the remote sink (default) is used.

## Constraints and usage notes
- `ToCSVString` contains a literal format-string typo (`"{7)"` instead of `"{7}"`), which is a source-confirmed defect rather than an inferred behavior — callers relying on `ToCSVString` for programmatic parsing should verify actual output.

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Framework.Logging/AuditInfoStruct.vb`
