winston-elasticsearch-apm
Advanced tools
Comparing version 0.0.5 to 0.0.7
var Transport = require('winston-compat').Transport; | ||
var util = require('util'); | ||
var defaultsDeep=require("lodash.defaultsdeep"); | ||
@@ -31,12 +32,17 @@ var ElasticsearchApm = function(options) { | ||
var errorMsg = null; | ||
if (meta == null || !Object.keys(meta).length) { | ||
var customData = {}; | ||
if (meta != null && Object.keys(meta).length && (meta.message != null || meta.stack != null)) { | ||
errorMsg = meta; | ||
customData = { label: this.label }; | ||
} else { | ||
errorMsg = msg; | ||
} else { | ||
errorMsg = meta; | ||
if (meta != null && typeof meta !== 'object') { | ||
meta = { meta: meta } | ||
} | ||
customData = defaultsDeep({ label: this.label }, meta || {}); | ||
} | ||
this.apm.captureError(errorMsg, { | ||
custom: { | ||
label: this.label | ||
} | ||
custom: customData | ||
}); | ||
@@ -43,0 +49,0 @@ } |
{ | ||
"name": "winston-elasticsearch-apm", | ||
"version": "0.0.5", | ||
"version": "0.0.7", | ||
"description": "Winston transport to send error stacks to Elasticsearch APM", | ||
@@ -21,2 +21,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"lodash": "^4.17.11", | ||
"lodash.defaultsdeep": "^4.6.0", | ||
"winston-compat": "^0.1.4", | ||
@@ -23,0 +25,0 @@ "winston-transport": "^4.2.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6833
138
5
+ Addedlodash@^4.17.11
+ Addedlodash.defaultsdeep@^4.6.0
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.defaultsdeep@4.6.1(transitive)