# Trying to output log/errors to table in web ui

**URL:** https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [24 November 2025 02:48 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762 "2025-11-24T02:48:10Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)
#### Post date: [24 November 2025 02:48 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/1 "2025-11-24T02:48:10Z")

</div>

I'm trying to output the node red logs into a table for easy debuging on my phone.... The problem is str needs to be a string of json, not the type [object Object] which it keeps giving me. Ive tried converting to string multiple ways with no luck.

I have the following function:

```auto
let logs = flow.get('logs') || []

var str = msg.payload.message

// prepare the row (keep other columns as-is)
let row = [
    //msg.payload.time || '',
    //msg.payload.type || '',
    msg.payload.source,
    str,
]

// debug: this needs to print a string! but it returns an object
node.error(str)

logs.push(row)

// cap at 20 rows
if (logs.length > 20) logs.shift()
flow.set('logs', logs)

msg.payload = logs
return msg

```

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [24 November 2025 02:51 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/2 "2025-11-24T02:51:13Z")

</div>

Pass the output of your function through a JSON node

Alternatively...

> [@Gibbz](#):
>
> `msg.payload = logs`

```js
msg.payload = JSON.stringify(logs)

```

---

<div class="post-metadata">

### Author: ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)
#### Post date: [24 November 2025 03:08 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/3 "2025-11-24T03:08:47Z")

</div>

Unfortunately for both, that converts the string to "[object Object]" instead of the contents of the object.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [24 November 2025 09:39 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/4 "2025-11-24T09:39:38Z")

</div>

How are you trying to display it? Are you using UIBUILDER, Dashboard 2 or Dashboard 1?

---

<div class="post-metadata">

### Author: ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)
#### Post date: [24 November 2025 10:03 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/5 "2025-11-24T10:03:19Z")

</div>

I'm using dashboard 2 with a table widget. Also output node.error displays the same format.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 November 2025 10:20 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/6 "2025-11-24T10:20:08Z")

</div>

Where does msg.payload.message come from? How is it constructed?

---

<div class="post-metadata">

### Author: ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)
#### Post date: [24 November 2025 10:32 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/7 "2025-11-24T10:32:58Z")

</div>

I'm using a catch node to catch errors. Passing them to this function. Then this function outputs to a table node.

Catch - function - table

Cheers

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 November 2025 10:46 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/8 "2025-11-24T10:46:19Z")

</div>

If you connect a debug node to the catch, showing the complete message object, what does it contain?

---

<div class="post-metadata">

### Author: ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)
#### Post date: [24 November 2025 20:50 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/9 "2025-11-24T20:50:21Z")

</div>

It contains the following object:

```auto
{"battery":100,"device":{"applicationVersion":147,"dateCode":"22092025","friendlyName":"Front Motion","hardwareVersion":1,"ieeeAddr":"0xa4c1386709fdfac3","manufacturerID":4742,"manufacturerName":"_TZE200_rhgsbacq","model":"ZG-204ZV","networkAddress":43435,"powerSource":"Battery","softwareBuildID":"0122092025","stackVersion":2,"type":"EndDevice","zclVersion":3},"fading_time":30,"humidity":70,"humidity_calibration":0,"illuminance":745,"illuminance_interval":1,"indicator":"OFF","linkquality":51,"motion_detection_sensitivity":2,"presence":false,"temperature":17.8,"temperature_calibration":0,"temperature_unit":"celsius"}

```

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 November 2025 21:42 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/10 "2025-11-24T21:42:29Z")

</div>

That data does not include a msg.payload, so no msg.payload.message.

Indeed, it can't be that you only shared the payload: no msg.message either

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 November 2025 22:09 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/11 "2025-11-24T22:09:38Z")

</div>

> [@Gibbz](#):
>
> It contains the following object:

What contains that object? Did you set the debug node to Output Complete Message as requested?

---

<div class="post-metadata">

### Author: ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)
#### Post date: [24 November 2025 22:42 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/12 "2025-11-24T22:42:30Z")

</div>

argh so silly! that was it.... msg.payload instead of msg.payload.message

Thanks guys

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [8 December 2025 22:42 UTC](https://discourse.nodered.org/t/trying-to-output-log-errors-to-table-in-web-ui/99762/13 "2025-12-08T22:42:47Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
