See node-red commands in console

Hi, I guess I have a very stupid question but I am node- red user since a months only so pls excuse this.

I used node red over a virtual machine running on Digitalocean. I am modifying a flow and need to adjust many nodes/functions for this. I used to have autostart not enabled for node-red, so I would access the console, start node red with the command "node-red" and get the welcome message + other info. Then I would see already some things like "connected to xy.db" and I would see error messages when I used interactive controls on the UI. This was very useful to adjust the flow and find the problems.
At this point I decided to enable auto start for node-red. Now I can not see these status and error messages any more. When I enter node-red in the console I get error-eaddrinuse: address already in use ..... Sure I do, because it is already running due to the autostart.
So... what is the right command/ how can I see these status and error messages again?
Many thanks,
Jacob

it depends how you autostart it... If you used our pi/debian/ubuntu script to install it then there may be a node-red-log command you can use.

Hi,
I used

  • sudo nano /etc/systemd/system/nodered.service
[Unit]
Description=Node-RED
After=syslog.target network.target

[Service]
ExecStart=/usr/local/bin/node-red --max-old-space-size=128 -v
Restart=on-failure
KillSignal=SIGINT

# log output to syslog as 'node-red'
SyslogIdentifier=node-red
StandardOutput=syslog

# if using a root user
WorkingDirectory=/root/
User=root
Group=root

[Install]
WantedBy=multi-user.target
  • sudo systemctl enable nodered.service

I tried "node-red-log" but the command wasn´t found.
So that means I would need to start a new server, configure it, reinstall node-red without the auto-start to be able to see life status messages in the console again?

Admin Edit. Added tripple backticks around the text so that the forum does not mess with it

As it says, the log will also be in syslog.

Hi Colin,
thanks understood. Since I am not a professional linux user - how can I access syslog using the console on a virtual machine server?

You should be able to use journalctl to see the log. Login to the server with a terminal and to watch the log as it happens try
sudo journalctl -f -u nodered -o cat

Otherwise this might do it
`tail -f /var/log/syslog | grep -i "node-red"

If that doesn't work then you may need to ask on a Digital Ocean.

Amazing,

sudo journalctl -f -u nodered -o cat

works just perfect. Thanks Colin, big big help.

All I did was look in the node-red-log command and pinched it from there.
I can never remember how to use journalctl, I don't use it often enough.

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