Nodered syslogging on raspberry pi

Hi All,

I have a flow (see below) that is trying to send a msg to the local syslog running on the same rpi as nodered. I am able to send the same msg to a remote syslog server, but not the local server. I would prefer to have it written tot the local syslog because the rpi is periodically disconnected from internet. Please advise what I can do/change to get these messages into the localhost syslog (/var/log/messages). Thanks In Advance

[{"id":"02f90e2212754b3f","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"d29dca5db151ecb2","type":"syslog-node","z":"02f90e2212754b3f","name":"","level":"6","category":"1","process":"Node-RED","pid":"0","hostname_mode":"automatic","hostname":"192.168.111.1","x":330,"y":140,"wires":[["a8a10fdefe9518a8"]]},{"id":"5b3e57fcacb0761d","type":"change","z":"02f90e2212754b3f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload & \" mS to 8.8.8.8\" & \" \" & $flowContext(\"statOffboard\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":140,"wires":[["d29dca5db151ecb2"]]},{"id":"a8a10fdefe9518a8","type":"udp out","z":"02f90e2212754b3f","name":"","addr":"127.0.0.1","iface":"","port":"514","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":530,"y":140,"wires":[]}]

I'm not sure if I got you right but a simple node.warn() will end up in syslog if that fits the bill. Not sure about node.log() though.

1 Like

TBH, when logging things from node-RED, I always find it much easier to create it's own log using node-red-contrib-flogger - node-red-contrib-flogger (node) - Node-RED
It enables limiting log size, log rotation, compression and various formats, and log results don't then get hidden amongst other sys log data.

How did you install node-red?

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