How to change the log level of the Exec/Debug nodes

Hi there,

In my project I display system data like CPU Load, Free disk space etc. . To do that I use the output of an exec node which queries the system data each 10s.

The problem is now that the exec node is spamming the system log on info level. My question is: Is there a way to change the log level of the exec node from "info" to "debug" in order to avoid my system logs from being spammed with useless information?

I also don't want to adapt the log level in my settings file to "warn", because I use debug nodes to create my other relevant internal logs. I am also not aware how I could adapt the log level of the debug node (which seems to be "info" as well by default). So in case I would switch to warn I would also switch off my relevant logs.

Or is this log level option probably already available in newer versions of nodered? I am currently stuck with version 1.0.3.

Thanks in advance.

Instead of doing this with system tools and the exec node, I use the nodes from node-red-contrib-os
This gives me all the information I need about CPU load and disk usage.
Maybe worth to look at.

Show us an example of the messages you want to log, and those you don't.

Thanks Urs, I'll take a look at it. Nevertheless it would be a nice nodered feature to enable debug nodes and exec nodes to change the log level they are using.
That way one could maintain Errors Logs which may come up by input faults etc. also as relevant in the logs.

Can you show us an example of the spamming you are talking about ? The only places I can see it log anything are for actual errors. (unless you have set the verbose flag in your settings.js - which was a "hangover" from a long time ago)

@Colin @dceejay
Currently my logs look like this:

So this is the output of the exec nodes which are called each 10 seconds. And this is not relevant at all for me. I also didn't find any way to influence the log level of the exec nodes rendering me powerless in this case. This is implemented within the exec nodes, there are no debug nodes linked to this.

On the other hand I have some debug nodes that output if a configuration error has been detected e.g.

In the flow I use debug nodes to create my output and selecting the option "System Console" to get the message into the logs. But again I do not see an option how I could change the log level using this node.

Or are there other nodes to handle such things?

so - have you accidentally got a verbose flag set in your settings.js ?

No there is no verbose flag in the settings file. At least the word verbose only is in a comment in the log level config:

hmmm - odd - something must be setting it.
Hopefully setting your level to "warn" will mean only warn or above will get shown - which isn't the fix - but unless we can find where that flag is getting set not sure what else to suggest.

If it isn't in the settings file, then are you running node-red with the -v argument?

Thanks for your response. So you mean that the exec node should not be sending its commands to the info log level?
Would you see it as a useful feature to gain control over log levels with the debug node? Is there a nodered standard node to log custom messages to other Log levels?

(History time - 7 years ago when we started we didn't have multiple levels - there was just the log - so we added the -v / verbose flag to allow extra detail... Since then we have added levels - so the flag should have become redundant.)

Nodered is actually started within a docker container Here is the executed start command

and what environment variables are you passing in ?

As an aside, we do have an item on the backlog to let you set the log level of a Debug node.

I think we should do a general review of where the somewhat legacy verbose flag is used in the core nodes and move it over to debug level messages.

Unfortunately I do not have details on that.

That is good to know thanks! This would be a really nice feature for better logging options on the application side.

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