Node-RED Logging

Does anyone here know how to make a logging system for Node-RED events similar to the logging system with HE? I would love to be able to track small bugs in my system without debug nodes everywhere.

There seems to be a console logger for NR, but I was wondering if anyone knows of a more convenient or streamlined approach.

Bonus points for a code profiling system like the recent HE updates have added to see bad algorithms or issues with my sequences/flows.

1 Like

I’d be interested in reading about that too.

1 Like

Just thinking aloud - maybe you could do something with a “Status” node and select the nodes that you are interested in logging?

There is an events node, but it hits everything, so I don’t know how heavy it would be on a system grabbing everything that is coming through it. I’ve used it for troubleshooting a time or two. You could pipe that into a file of some sort, I’m sure.

I feel like @jchurch might have some ideas. I’m always bugging him when I need node red guidance.

Are you referring to the HE events node? That’s what I use to log all HE events from node-red. However, if you want to log what’s happening in your flows, the built-in status node may be more applicable?

Maybe look into NR logging here and add a custom logger that sends metrics events to a Logstash instance over a TCP connection.

2 Likes

:grin: :point_up:
What he said!

1 Like

Yah but I thought it was a system node not an HE node because I didn’t check first. I was mistaken. But, that’s how we learn.

1 Like

Yeah I don’t think think the status node would work, to my knowledge that is for showing the status text that appears below a node onto another node (in the case of a subflow) or just outputting that text as a payload. But it deals specifically with the status text that shows below a node, for instance time left on a timer, or in the case of HE nodes, the current status or function to activate.

Yeah I saw that, but boy does that seems like an undertaking…which was why before I get into the weeds I wanted to see if anyone had any other suggestions.

1 Like