# Documentation on msg format for custom logging

**URL:** <https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624>\
**Category:** General\
**Created:** [4 April 2021 05:28 UTC](https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624 "2021-04-04T05:28:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kolban](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kolban/32/10366_2.png) [@kolban](https://discourse.nodered.org/u/kolban)\
**Post date:** [4 April 2021 05:28 UTC](https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624/1 "2021-04-04T05:28:24Z")

</div>

I am looking to provide a custom logging provider. When I read the docs found here:

[https://nodered.org/docs/user-guide/runtime/logging#custom-logging-module](https://nodered.org/docs/user-guide/runtime/logging#custom-logging-module)

I see that I am responsible for returning a function that takes a `msg` as input. Unfortunately, I am not finding what the structure/content of `msg` might contain. Can we have that described and ideally added to the documentation?

---

<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:** [4 April 2021 06:30 UTC](https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624/2 "2021-04-04T06:30:37Z")

</div>

The message can contain anything you like, there is nothing special about it.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 April 2021 07:51 UTC](https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624/3 "2021-04-04T07:51:25Z")

</div>

In this instance, `msg` is a logging event message, so it does have a predefined set of properties.

Will look at adding some docs on it.

In the meantime, here's the default console logger so you can see what properties it uses: [node-red/log.js at bccfd21cf46da7dfdde9653466f218fb3459ad7d · node-red/node-red · GitHub](https://github.com/node-red/node-red/blob/bccfd21cf46da7dfdde9653466f218fb3459ad7d/packages/node_modules/%40node-red/util/lib/log.js#L79)

---

<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:** [4 April 2021 08:11 UTC](https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624/4 "2021-04-04T08:11:12Z")

</div>

> [@knolleary](#):
>
> In this instance, `msg` is a logging event message, so it does have a predefined set of properties.

I stand corrected. Thanks. That means I have misunderstood something, I need to have a more detailed play with this.

---

<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:** [18 April 2021 08:11 UTC](https://discourse.nodered.org/t/documentation-on-msg-format-for-custom-logging/43624/5 "2021-04-18T08:11:15Z")

</div>

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