# Worker Message Logs

A Workers Message Log allows you to:

* see the flow and sequence of messages sent between Workers at run-time
* see when and where any errors have occurred in your applications
* access a running Worker's MHL cases (right-click menu option)
* see custom debug messages

An example of a Workers Message Log is shown below, showing the sequence of messages that have been sent to Worker MHL cases.

![Workers Message Log](https://2767648102-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZWihGdeYUalj239OUdAB%2Fuploads%2FrIpV24gFFvOVcC9wrjXV%2Fimage.png?alt=media\&token=cb98daf6-1720-45d1-a2b9-dffec829d959)

{% hint style="info" %}
A single Message Log window is created for each Workers application that is defined by the Head Worker's Alias and the IP Address of where the Workers application is running. Therefore, it is possible to have more than one Workers application sending messages to the same Message Log, **IF** the Head Worker's Alias and IP Address of the applications are the same.
{% endhint %}

## Buttons

### (Live) Logging

When TRUE, any new messages that are acquired by the Message Log will be logged to a comma delimited text file, with each Message Log [Column ](#columns)(regardless of whether they are visible or not) separated with a comma. You can set Live Logging to be either TRUE or FALSE when a Message Log is created, from within the Debug Server's [Settings](https://docs.workersforlabview.io/workers-tools/workers-tools-menu/workers-debug-server/settings).

### Sort

Will sort the Message Log rows by the high resolution timestamp value in the [Count (sec) ](#count-sec)column.

### Pause

Pauses only the visible updating of new messages to the Message Log front panel. It does not pause the logging of messages to file (if Live Logging is selected).

### WID

Toggles between the Worker's ID (WID) or the Worker's Alias for both the [Enque Worker](#enque-worker) and [Deque Worker](#deque-worker) columns.

### Resize

Automatically resizes the width of all columns based on the longest string in each column.

### Filter

Applies a filter to the message log, based on the contents in the fields: **String to Filter**, **Column** and **Type**.

{% hint style="info" %}
More than one filter can be applied, allowing you to apply filters on top of filters.
{% endhint %}

### Undo

Un-applies the previously applied filter.

### Clear

Clears all applied filters.

## Columns

Every time a message is dequeued within a Worker's MHL, meta-data about the message is forwarded to the Worker's Debug Client (if one exists), and then sent to the Debug Server's Message Log (if one exists). The following information about the message is provided in the Message Log's columns.

{% hint style="info" %}
**Good to know**

When a Message Log connects to a Debug Client, the order of the messages that appear in the Message Log is the order that the messages were dequeued by their respective MHLs, and **not** the order that the messages were enqueued. Pressing the **Sort** button will sort the messages by the time the messages were enqueued.
{% endhint %}

### Count (sec)

This column exists on the very right of the Message Log, and contains a high-resolution timestamp of when the message was **enqueued** (provided by the LabVIEW palette VI: *High Resolution Relative Seconds.vi*.) It is not possible to disable this column.

### Time/Date

Provides a human-readable low resolution timestamp of when a message was enqueued.

### Enque Worker

The WID or alias of the Worker that enqueued the message.

{% hint style="warning" %}
If this field is blank, it is probably because the message was enqueued **without** the Caller's  [Main Data Wire](https://docs.workersforlabview.io/fundamental-concepts/important-terms#worker-main-data-wire) connected to the **Caller** input terminal of a Public Request VI. This terminal is not required if the Public Request VI is being used from an external LabVIEW application or from TestStand.
{% endhint %}

### Enque Case

The MHL case that the message was enqueued from.

{% hint style="warning" %}
If this field is blank, it is probably because the message was enqueued **without** the Caller's  [Main Data Wire](https://docs.workersforlabview.io/fundamental-concepts/important-terms#worker-main-data-wire) connected to the **Caller** input terminal of a Public Request VI. This terminal is not required if the Public Request VI is being used from an external LabVIEW application or from TestStand.
{% endhint %}

### Deque Worker

The WID or alias of the Worker that dequeued the message.

### Deque Case

The MHL case that received the message.

### Priority

The priority of the message.

### Message

Messages sent between MHL cases do not contain an additional message string. This column is reserved for use by **Error** and **User** messages (see below).

#### Error Message

Sent by the framework's *Error Handler.vi* which exists after the case structure in every Worker MHL. If an error is received on this VI's **error in** input terminal, the error will be sent to the Message Log. The timestamp for the message is created within *Error Handler.vi*.

{% hint style="info" %}
**Good to know**

*Error Handler.vi* can be placed anywhere in your code where you want to catch errors to be sent to the Message Log.
{% endhint %}

#### User Message

Sent by use of the Worker's palette VI: *Send Debugger Message.vi*. Users can place this VI anywhere in their code where they want to send a custom message to the Message Log. The timestamp for the message is created within *Send Debugger Message.vi*.

{% hint style="info" %}
**Good to know**

The Enque and Deque columns contain data for both error and user messages. This data comes from the MHL case that sent the error or user message, allowing you to see, for example, which Worker MHL case sent the error or user message (i.e. Deque Worker and Deque Case).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.workersforlabview.io/workers-tools/workers-tools-menu/workers-debug-server/worker-message-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
