@theotherwillembotha/node-red-logging 0.3.0

Console and REST endpoint logger nodes for Node-RED. Built on @theotherwillembotha/node-red-plugincore.

npm install @theotherwillembotha/node-red-logging

@theotherwillembotha/node-red-logging

Console and REST endpoint logger provider nodes for Node-RED, built on the @theotherwillembotha/node-red-plugincore framework.

This plugin does not add flow nodes to the palette. Instead it provides config nodes that act as logger backends - any node in the plugincore ecosystem that supports the logger selector can use them.


Nodes

Console Logger

Writes structured log output to the Node-RED runtime console (stdout). Suitable for local development and containerised environments where stdout is captured by a log aggregator.

REST Endpoint Logger

POSTs log messages to an HTTP or HTTPS endpoint as a JSON payload, using Winston's Http transport. Supports Basic and API key authentication.


Installation

npm install @theotherwillembotha/node-red-logging

This plugin requires @theotherwillembotha/node-red-plugincore to be present in the Node-RED environment (either installed as a dependency or volume-mounted in Docker).


Configuration

Console Logger

Field Description
Name A descriptive label for this logger instance.
Level Minimum log level. Messages below this threshold are suppressed. Options: DEBUG, INFO, WARNING, ERROR.
Template A Mustache/Handlebars template that formats the log message body (see Templating below).

REST Endpoint Logger

Field Description
Name A descriptive label for this logger instance.
Level Minimum log level. Options: DEBUG, INFO, WARNING, ERROR.
URL The HTTP or HTTPS endpoint that log messages will be POSTed to.
Ignore Invalid SSL certificates When enabled, self-signed or invalid certificates are accepted.
Authentication The authentication strategy: None, Basic, or ApiKey.
Template A Mustache/Handlebars template that formats the log message body (see Templating below).

Authentication - Basic

Field Description
Username HTTP Basic Auth username.
Password HTTP Basic Auth password.

Authentication - API Key

Field Description
Mechanism Where the key is injected: Header, Query Param, or Matrix Param.
APIKey name The key name (e.g. x-api-key).
APIKey value The key value.

Templating

Both loggers use a Mustache/Handlebars template to format the log message body. The template is edited using a syntax-highlighted editor in the node configuration panel.

Available variables

Variable Type Description
msg object The Node-RED message object associated with the log entry.
currentTime string The current timestamp in ISO 8601 format.

Helpers

Helper Description
json Serialises a value to a JSON string. Usage: {{{json msg}}}.

Examples

{{{json msg}}}

Serialises the full message object as compact JSON.

[{{currentTime}}] {{msg.topic}}: {{{json msg.payload}}}

Formats a timestamped, topic-prefixed log line with a JSON payload.


How loggers are selected

Once this plugin is installed alongside any other plugincore plugin, its logger nodes appear automatically in the logger dropdown of any node that supports logging. No additional configuration in those plugins is required - the plugincore NodeTypeService discovers available logger types by their LoggerType tag at runtime.

If this plugin is not installed, the logger selector in other nodes is simply hidden. There is no error or degradation - logging silently does nothing via a no-op appender.


Related plugins

Plugin Description
node-red-plugincore Framework core - required peer dependency
node-red-loki Grafana Loki logger provider

License

ISC

Node Info

Version: 0.3.0
Updated 4 days ago
License: ISC
Rating: not yet rated

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • ConsoleLoggerConfigNode
  • RestLoggerConfigNode

Keywords

  • node-red
  • logging
  • console
  • rest
  • observability

Maintainers