... // Configure the logging output logging: { // Only console logging is currently supported 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", // 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 }, logstash: { level:'info', metrics:false, handler: function(conf) { var net = require('net'); var logHost = '127.0.0.1',logPort = 8124; var conn = new net.Socket(); conn.connect(logPort,logHost) .on('connect',function() { console.log("Logger connected") }) .on('error', function(err) { // Should attempt to reconnect in a real env // This example just exits... process.exit(1); }); // Return the function that will do the actual logging return function(msg) { var message = { '@tags': ['node-red', 'test'], '@fields': msg, '@timestamp': (new Date(msg.timestamp)).toISOString() } try { conn.write(JSON.stringify(message)+"\n"); }catch(err) { console.log(err);} } } } }, ...
... // Configure the logging output logging: { // Only console logging is currently supported 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", // 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 }, logstash: { level:'info', metrics:false, handler: function(conf) { var net = require('net'); var logHost = '127.0.0.1',logPort = 8124; var conn = new net.Socket(); conn.connect(logPort,logHost) .on('connect',function() { console.log("Logger connected") }) .on('error', function(err) { // Should attempt to reconnect in a real env // This example just exits... process.exit(1); }); // Return the function that will do the actual logging return function(msg) { var message = { '@tags': ['node-red', 'test'], '@fields': msg, '@timestamp': (new Date(msg.timestamp)).toISOString() } try { conn.write(JSON.stringify(message)+"\n"); }catch(err) { console.log(err);} } } } }, ...