forked from winstonjs/node-loggly
-
Notifications
You must be signed in to change notification settings - Fork 23
Loggly logs are sent without tags #83
Copy link
Copy link
Open
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
The uri used does not have the /tags/{tags}. It is properly set in requestOptions, but axios uses the first param as the url to send to. So the code should sync the uri variable with the formatted uri in requestOptions
Today I used patch-package to patch node-loggly-bulk@4.0.2 for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/node-loggly-bulk/lib/loggly/common.js b/node_modules/node-loggly-bulk/lib/loggly/common.js
index 58d3db1..ac1de16 100755
--- a/node_modules/node-loggly-bulk/lib/loggly/common.js
+++ b/node_modules/node-loggly-bulk/lib/loggly/common.js
@@ -143,8 +143,10 @@ common.loggly = function () {
if (callback) { callback(err) }
}
}
+ uri = (isBulk && headers['X-LOGGLY-TAG']) ? uri + '/tag/' + headers['X-LOGGLY-TAG'] : uri;
+
var requestOptions = {
- uri: (isBulk && headers['X-LOGGLY-TAG']) ? uri + '/tag/' + headers['X-LOGGLY-TAG'] : uri,
+ uri,
method: method,
headers: isBulk ? {} : headers || {}, // Set headers empty for bulk
proxy: proxy,This issue body was partially generated by patch-package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels