# How to enable trace logging in @node-red/runtime/lib/storage/localfilesystem/util.js

**URL:** <https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204>\
**Category:** Core Development\
**Created:** [7 February 2025 09:51 UTC](https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204 "2025-02-07T09:51:34Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [7 February 2025 09:51 UTC](https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204/1 "2025-02-07T09:51:34Z")

</div>

I am looking at the file context write sequence to try to see if I can see any improvements to reduce the likelihood of corruption triggered by power fail. How can I enable the trace logging in [node-red/packages/node\_modules/@node-red/runtime/lib/storage/localfilesystem/util.js at master · node-red/node-red · GitHub](https://github.com/node-red/node-red/blob/master/packages/node_modules/%40node-red/runtime/lib/storage/localfilesystem/util.js)? I tried setting the log level to trace in settings.js and lots of extra stuff came out, but not the util.js logs.

---

<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:** [7 February 2025 11:08 UTC](https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204/2 "2025-02-07T11:08:40Z")

</div>

I don't know the answer. But have you tried using the inspector nodes? That lets you track what is happening in your browser dev tools.

---

<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:** [7 February 2025 11:24 UTC](https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204/3 "2025-02-07T11:24:30Z")

</div>

Thanks. I don't really need that complexity. I just want to understand what it is doing. The existing optional logging would do, at least initially, if I could just switch it on.

The code uses  
`const log = require("@node-red/util").log;`  
Then logs using `log.trace()`, but setting log level to trace in settings.js does not enable it.

---

<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:** [7 February 2025 11:34 UTC](https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204/4 "2025-02-07T11:34:43Z")

</div>

> [@Colin](#):
>
> The code uses

The normal approach for custom nodes is to use `RED.log.trace()` of course. Hard to track whether the direct require of the util log is the same thing. I assumed it was.

> [@Colin](#):
>
> I don't really need that complexity

Personally, I find that, unless you set up a custom logger, the amount of data from a working system when logs are turned up to trace level is unusable.

Instead, I put a breakpoint in the area of code I'm interested in and then can step through and see the data passing through as well.

---

<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 April 2025 11:35 UTC](https://discourse.nodered.org/t/how-to-enable-trace-logging-in-node-red-runtime-lib-storage-localfilesystem-util-js/95204/5 "2025-04-08T11:35:08Z")

</div>

Closed on 8 April 2025 11:35 UTC

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