# Announce node-red-contrib-http-logger

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178>\
**Category:** Share Your Nodes\
**Created:** [21 October 2018 21:16 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178 "2018-10-21T21:16:05Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [22 April 2019 21:58 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/21 "2019-04-22T21:58:47Z")

</div>

> [@osalonga](#):
>
> (2) the request payload in json format is transformed to string data type

@osalonga:  
A new version ( **2.0.1** ) is available on Github. Similar to the http-request node, it is now possible to select the _ **output return format** _ (for body request and response bodies) in the config screen:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7e47942e729f04972d2554bb78d79c3f02953560.png)

I have also changed the code to make sure that NodeJs works with _ **binary** _ data (i.e. buffer), and you can optionally select in the config screen to convert the binary data to a string or a JSON object. That way no bytes will be messed up, in case you want to keep the binary body ...

A new section (with example flow) has been added to the [readme](https://github.com/bartbutenaers/node-red-contrib-http-logger#return-body-format) file.

> [@osalonga](#):
>
> (1) api key or auth headers got lost or over written before the endpoint is fired up.

Can you provide a simple example flow and explain what is going wrong. I have never used the api key before, so it would be more efficient if I don't have to digg into the details of it ...

---

<div class="post-metadata">

**Author:** ![osalonga](https://avatars.discourse-cdn.com/v4/letter/o/e47774/32.png) [@osalonga](https://discourse.nodered.org/u/osalonga)\
**Post date:** [24 April 2019 19:41 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/22 "2019-04-24T19:41:44Z")

</div>

@BartButenaers , See attached.

[flow.json](https://discourse.nodered.org/uploads/short-url/3X7y8GYE0sFlNIOKe2GmBFx1wo7.json) (2.1 KB)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [24 April 2019 21:09 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/23 "2019-04-24T21:09:32Z")

</div>

@osalonga,  
It would have been nice if you had added at least some information about your flow...

I have started your 'http-request' node (on older Node-RED v0.19.5), but after some time my flow aborts:

```auto
24 Apr 22:51:39 - [info] [function:setGetData] Complete
24 Apr 22:52:00 - [error] [http request:get] Error: getaddrinfo EAI_AGAIN developer.nrel.gov:443
24 Apr 22:53:10 - [info] [function:setGetData] Complete
24 Apr 22:53:30 - [red] Uncaught Exception:
24 Apr 22:53:30 - Error: getaddrinfo EAI_AGAIN developer.nrel.gov:443
    at Object._errnoException (util.js:1022:11)
    at errnoException (dns.js:55:15)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

```

Don't think this is caused by my logger-node, since I haven't started it at this point yet...

> [@osalonga](#):
>
> (1) api key or auth headers got lost or over written before the endpoint is fired up

Is that another issue, or is it somehow related to this test flow?

As I already mentioned above: I have no experience at all with api keys, and I have no time left to figure it out on my own...

---

<div class="post-metadata">

**Author:** ![defabiouy](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@defabiouy](https://discourse.nodered.org/u/defabiouy)\
**Post date:** [21 August 2020 17:03 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/24 "2020-08-21T17:03:58Z")

</div>

Hello people!  
I was able to use this node with urls (like @BartButenaers examples) but when I tried to use with ip directions (like 190.xxx.xxx.xxx) it didn't work.  
You know if I need set something particular, or this node doesn't work without dns?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [21 August 2020 21:50 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/25 "2020-08-21T21:50:45Z")

</div>

Hi Fabio,  
Welcome to this forum!  
Could you please give me some extra information about your issue. For example:

- The examples from my readme page work correctly in your flow. Is that correct?
- Can you please explain a bit more what you mean with `ip directions`?
- So you call an ip address 190.xxx.xxx.xxx with the http-request node, or do you mean something else?

---

<div class="post-metadata">

**Author:** ![defabiouy](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@defabiouy](https://discourse.nodered.org/u/defabiouy)\
**Post date:** [22 August 2020 04:37 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/26 "2020-08-22T04:37:34Z")

</div>

Hi Bart, thanks for your quickly reply! And yes... I am new in this forum and in node-red world 🙂  
Answering your questions:

Exactly, your examples work perfectly.  
If at the http request node I put: "[https://api.ipify.org?format=json](https://api.ipify.org?format=json)", and in http logger nodes I put: "ipify" or "https", etc. It works, even if I leave the URL filter empty.  
However, if at the http request node I put something like: "192.168.0.109/device", and in http logger nodes I put: "device" or "192", etc. It doesn't work, not even if I leave URL filter empty.

I suppose that http request node works only with strings.

The thing is it would be great if I could logging access to my server, but I can't assign a dns to my IP. So, your node seemed perfect but I couldn't make it work in the way that I need it.

Thanks again!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [22 August 2020 07:25 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/27 "2020-08-22T07:25:05Z")

</div>

> [@defabiouy](#):
>
> However, if at the http request node I put something like: "192.168.0.109/device", and in http logger nodes I put: "device" or "192", etc. It doesn't work

I have no explanation for that at the moment. Would have thought that this should work ...

Problem is that the http-logger node doesn't work anymore in my current setup (nodeJs version 12.18.3). Have been debugging this morning, but is like looking a needle in a haystack... Finally I found something weird in my [code](https://github.com/bartbutenaers/node-red-contrib-http-logger/blob/master/http_logger.js#L53):

```auto
var mitm_singleton = new Mitm();

```

Have found at last that it seems to work again when I remove the `new`...  
My time is up now. Will have a look at this tonight ...

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [22 August 2020 20:10 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/28 "2020-08-22T20:10:21Z")

</div>

> [@BartButenaers](#):
>
> Have found at last that it seems to work again when I remove the `new` ...

I have removed the `new` in my Github repository, and then it works again for me ...  
You can install my version directly from Github like this (from within your Node-RED folder!!):

```auto
npm install bartbutenaers/node-red-contrib-http-logger

```

I have also tried it for an IP address:

- I access some of my devices via a http request node:

- And then I start listening, with this IP address as the filter value:

- And the http-logger node shows me this output message:

But I have to admit that the whole MITM stuff is quite obscure...  
If this doesn't work in your case, I have not much ideas left what is going wrong ...

---

<div class="post-metadata">

**Author:** ![defabiouy](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@defabiouy](https://discourse.nodered.org/u/defabiouy)\
**Post date:** [31 August 2020 14:08 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/29 "2020-08-31T14:08:32Z")

</div>

Hi Bart! I had on vacations last week... and disconected of all 🙂 I am just catching up with all my mails.  
I will try with your new version and I will tell you how it works!

We talk later 👍

---

<div class="post-metadata">

**Author:** ![defabiouy](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@defabiouy](https://discourse.nodered.org/u/defabiouy)\
**Post date:** [10 September 2020 19:49 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/30 "2020-09-10T19:49:31Z")

</div>

Hi Bart!  
I tell you... I installed your new version, restarted node-red and test it. Unluckly it didn't work. Even it hung the node-red. In the console It logs:  
10 Sep 15:48:57 - [red] Uncaught Exception:  
10 Sep 15:48:57 - Error: getaddrinfo ENOTFOUND 190.0.NNN.NNN:1883  
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)

For now, these are the news. I will investigate about this exception and I will update you if I found something.

[Previous page](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178.md?page=1)
