The Node-RED runtime has the ability to generate log messages. By default, these are written to the console. There is documentation which shows that these messages can be written elsewhere ... what if we want to log to cloud logging?
Reviewing the docs, it seems that at the highest level we can code:
After some consideration, I'm no longer seeing as much value in this feature as I may have initially thought. The original thinking was to write all the log records from Node-RED to their own Cloud Logging log. However I now am questioning the value of that. How will we distinguish one NR engine instance from another? How will we know which flow issued the message?
The Node-RED runtime has the ability to generate log messages. By default, these are written to the console. There is documentation which shows that these messages can be written elsewhere ... what if we want to log to cloud logging?
Reviewing the docs, it seems that at the highest level we can code:
The
message
passed to the function includes:level
- The level of the message. A number.msg
- The string of the messagetimestamp
- A timestamp for the messageThe level codes appear to be:
See also:
Thoughts
After some consideration, I'm no longer seeing as much value in this feature as I may have initially thought. The original thinking was to write all the log records from Node-RED to their own Cloud Logging log. However I now am questioning the value of that. How will we distinguish one NR engine instance from another? How will we know which flow issued the message?