Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/NGRP/node-red-contrib-viseo

  • Loading branch information...
Klervix committed Aug 2, 2019
2 parents 7d4b057 + c451d63 commit 6d7ed2aadf4fbd81e0c2a35ba36272d373e19d2b
Showing with 15 additions and 14 deletions.
  1. +15 −14 node-red-contrib-log/node-azure-appinsight.js
@@ -37,20 +37,21 @@ const close = (done) => {

// See https://github.com/Microsoft/ApplicationInsights-node.js/tree/master
const input = (node, data, config) => {

let log = config.log || "payload";
if (config.logType === "msg") log = helper.getByString(data, log) ;
let name = (config.evtnameType === "msg") ? helper.getByString(data, config.evtname) : config.evtname;
let type = config.evttype || 'event';

if (type === 'event'){
client.trackEvent(name, log);
} else if (type === 'metric'){
client.trackMetric(name, parseInt(log));
} else if (type === 'trace'){
client.trackTrace(log);
} else if (type === 'error'){
client.trackException(new Error(log));
if (client) {
let log = config.log || "payload";
if (config.logType === "msg") log = helper.getByString(data, log) ;
let name = (config.evtnameType === "msg") ? helper.getByString(data, config.evtname) : config.evtname;
let type = config.evttype || 'event';

if (type === 'event'){
client.trackEvent(name, log);
} else if (type === 'metric'){
client.trackMetric(name, parseInt(log));
} else if (type === 'trace'){
client.trackTrace(log);
} else if (type === 'error'){
client.trackException(new Error(log));
}
}

node.send(data);

0 comments on commit 6d7ed2a

Please sign in to comment.
You can’t perform that action at this time.