I just tried this in my function node:
node.warn("hi from node.warn")
node.log("hi from node.log")
return msg;
and in settings.js, I commented out metrics and audit so my log settings are:
console: {
/** Level of logging to be recorded. Options are:
* fatal - only those errors which make the application unusable should be recorded
* error - record errors which are deemed fatal for a particular request + fatal errors
* warn - record problems which are non fatal + errors + fatal errors
* info - record information about the general running of the application + warn + error + fatal errors
* debug - record information which is more verbose than info + info + warn + error + fatal errors
* trace - record very detailed logging + debug + info + warn + error + fatal errors
* off - turn off all logging (doesn't affect metrics or audit)
*/
// level: "info",
level: "trace"
/** Whether or not to include metric events in the log output */
// metrics: false,
/** Whether or not to include audit events in the log output */
// audit: false
}
and this shows up in the log starting NR with just 'node-red':
28 Oct 19:37:50 - [warn] [function:function 7] hi from node.warn
28 Oct 19:37:50 - [info] [function:function 7] hi from node.log
so I stoped and started node-red with 'node-red-start' and get this:
28 Oct 19:41:54 - [info] Started flows
28 Oct 19:41:54 - [info] [sqlitedb:b48607bf.623f88] opened /home/pi/databases/hvac4.db ok
28 Oct 19:41:54 - [info] [mqtt-broker:mqttpizw] Connected to broker: mqtt://192.168.48.70:1883
28 Oct 19:41:54 - [trace] comms.open U9SrUUNHtp8oqMskHLcwp5afGWE7GDNrr2VVADeYEXs=
28 Oct 19:41:55 - [trace] git["rev-list","HEAD","--count"]
28 Oct 19:41:55 - [trace] git["log","--format=sha: %H%nparents: %p%nrefs: %D%nauthor: %an%ndate: %ct%nsubject: %s%n-----","-n 20"]
28 Oct 19:41:55 - [trace] git["rev-list","HEAD","--count"]
28 Oct 19:41:56 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
28 Oct 19:41:56 - [trace] git["status","--porcelain","-b"]
28 Oct 19:41:59 - [warn] [function:function 7] hi from node.warn
28 Oct 19:41:59 - [info] [function:function 7] hi from node.log
so I uncommented metrics and audits and I still see the outputs in the log.
It could be that it is there but too much other info is being dumped to the log so you miss it.