# FactoryTalk

# FTView

# Logging from FTView VBA

If you need to add diagnostic logging to the VBA of a FTView control or window, you can leverage this:

`Application.LogDiagnosticsMessage`

Here are examples:

```vb.net
Private Sub Button6_Released()
    Application.LogDiagnosticsMessage "Informational Log Message", ftDiagSeverityInfo
End Sub

Private Sub Button7_Released()
    Application.LogDiagnosticsMessage "Audit Log Message", ftDiagSeverityAudit
End Sub

Private Sub Button10_Released()
    Application.LogDiagnosticsMessage "Warning Log Message", ftDiagSeverityWarning
End Sub

Private Sub Button11_Released()
    Application.LogDiagnosticsMessage "Error Log Message", ftDiagSeverityError
End Sub

```

The above are Below are VBA methods that will output messages to the FT diagnostic event log, like this:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-06/scaled-1680-/O0TOT4ig6p8HfKlw-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-06/O0TOT4ig6p8HfKlw-image.png)

<p class="callout info">NOTE: The audit log level outputs two messages. One as audit and one as informational.</p>