Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log 'request' events initiatied by request.log() immediately #190

Closed
findesk opened this issue Sep 11, 2014 · 7 comments · Fixed by #284
Closed

Log 'request' events initiatied by request.log() immediately #190

findesk opened this issue Sep 11, 2014 · 7 comments · Fixed by #284
Assignees
Labels
Milestone

Comments

@ghost
Copy link

@ghost ghost commented Sep 11, 2014

good currently doesn't log immediately when calling request.log(). Instead good logs at the request tail (or request response) event. If you have extendedRequests true, Good then includes request._logger (the list of request log lines) as a property of the request log output.

Please consider enhancing good to output log lines immediately when request.log() is called, with detail on the request (such as request.id) included in the log line?

(For context, see: #117)

@findesk findesk changed the title Log 'request' events initiatied by request.log() Log 'request' events initiatied by request.log() immediately Sep 11, 2014
@selfcontained

This comment has been minimized.

Copy link

@selfcontained selfcontained commented Oct 13, 2014

I've also spent quite a bit of time trying to see if I was missing something, but it turns out I was just expecting something very different than what Good offers out of the box. A call to request.log() seems like it ought to output something, especially when I have filtering turned off, and when calls to server.log() do output something. I would like to log events using the request to benefit from including something like the request id on each log entry (which I've also found that there doesn't seem to be a way to add this to the log output easily).

@arb arb modified the milestone: 4.0.0 Oct 16, 2014
@findesk findesk removed this from the 4.0.0 milestone Oct 16, 2014
@arb arb added this to the 3.2.0 milestone Oct 24, 2014
@arb

This comment has been minimized.

Copy link
Contributor

@arb arb commented Oct 24, 2014

I opened a related issue to this on hapi. As it stands, making this work would be hacky at best and really hacky at worst.

@arb arb removed this from the 3.2.0 milestone Oct 24, 2014
@selfcontained

This comment has been minimized.

Copy link

@selfcontained selfcontained commented Oct 24, 2014

Yah, I can understand that. We've resulted to just writing our own console reporter that also logs the additional log entries instead of just the single request log entry. It doesn't log them immediately, but at least they're logged w/ the reporter.

@arb

This comment has been minimized.

Copy link
Contributor

@arb arb commented Nov 14, 2014

Looks like this will be possible in hapi-8 per this commit hapijs/hapi@fe1dd2d

@arb arb added the feature label Dec 1, 2014
@arb arb modified the milestone: 5.0.0 Dec 1, 2014
@phated

This comment has been minimized.

Copy link

@phated phated commented Dec 10, 2014

I'd like to tackle this. @arb how do you see this working?

@arb

This comment has been minimized.

Copy link
Contributor

@arb arb commented Dec 11, 2014

I think you should be able to just listen for server.on('request') now and then just emit a request event with a payload. Should work very similar to how the existing ones work.

@arb arb added this to the 5.1.0 milestone Dec 16, 2014
@arb

This comment has been minimized.

Copy link
Contributor

@arb arb commented Dec 16, 2014

What do you all envision the payload of this event being? @lloydbenson or @geek any thoughts on this? Same as the "response" event just with all the response specific data points removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.