question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Req element twitce with hapi.

See original GitHub issue

Any ideas why im getting req twice in logged json?

	"level": 30,
	"time": 1573488495601,
	"pid": 6012,
	"hostname": "nodejs",
	"req": {
		"id": "1573488495579:nodejs:6012:k2umf1vz:10000",
		"method": "get",
		"url": "http://192.168.0.128:4010/hello/world/",
		"headers": {
			"content-type": "application/json",
			"user-agent": "PostmanRuntime/7.19.0",
			"accept": "*/*",
			"cache-control": "no-cache",
			"postman-token": "ae33203b-1dc5-4f93-998f-f450ba43279f",
			"host": "192.168.0.128:4010",
			"accept-encoding": "gzip, deflate",
			"connection": "keep-alive"
		},
		"remoteAddress": "192.168.0.1",
		"remotePort": 60046
	},
	"req": {
		"id": "1573488495579:nodejs:6012:k2umf1vz:10000",
		"method": "get",
		"url": "http://192.168.0.128:4010/hello/world/",
		"headers": {
			"content-type": "application/json",
			"user-agent": "PostmanRuntime/7.19.0",
			"accept": "*/*",
			"cache-control": "no-cache",
			"postman-token": "ae33203b-1dc5-4f93-998f-f450ba43279f",
			"host": "192.168.0.128:4010",
			"accept-encoding": "gzip, deflate",
			"connection": "keep-alive"
		},
		"remoteAddress": "192.168.0.1",
		"remotePort": 60046
	},
	"res": {
		"statusCode": 200,
		"headers": {
			"content-type": "application/json; charset=utf-8",
			"vary": "origin,accept-encoding",
			"access-control-expose-headers": "WWW-Authenticate,Server-Authorization",
			"cache-control": "no-cache",
			"content-encoding": "gzip"
		}
	},
	"responseTime": 22,
	"msg": "request completed",
	"v": 1
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
aorinevocommented, Feb 5, 2020

We are seeing the same error as well.

@indreek, have you been able to identify the root cause?

0reactions
AdriVanHoudtcommented, Mar 14, 2022

I think I’ve found a way to better handle this. Please take a look at https://github.com/pinojs/hapi-pino/pull/157

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Req element twitce with hapi. - - Bountysource
Any ideas why im getting req twice in logged json? ```{ "level": 30, "time": 1573488495601, "pid": 6012, "hostname": "nodejs", "req": {
Read more >
Nodejs HAPI request getting called twice from browser
I am a newbie to Node and am trying to host a restful service using hapi.js, my code is as follows: server.route({ method:...
Read more >
18.4.2 API Reference - hapi.dev
To obtain the active authentication configuration of a route, use server.auth.lookup(request.route) . const Hapi = require('hapi ...
Read more >
Chapter 3: Routes, request, and reply | Hapi With Typescript
how Hapi maps incoming URLs to a processing function;; elements of this routing mechanism;; how to process parameters in the URL;; how to...
Read more >
hapijs/hapi - Gitter
Hey, I am trying to make a cross origin POST request with credentials on an endpoint. I am having issues with the preflight...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found