Skip to content

Loggly logs are sent without tags #83

@jhcarrington

Description

@jhcarrington

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions