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

New Event for request.log #2048

Closed
arb opened this issue Oct 24, 2014 · 6 comments
Closed

New Event for request.log #2048

arb opened this issue Oct 24, 2014 · 6 comments
Assignees
Labels
breaking changes Change that can breaking existing code feature New functionality or improvement
Milestone

Comments

@arb
Copy link
Contributor

arb commented Oct 24, 2014

I think we should change the event that is emitted from request.log(). Currently, "request" is emitted multiple times per request so if your client is only interested in the call to log, they need to do some filtering.

Maybe "requestlog" or something.

Relates to hapijs/good#190

@hueniverse
Copy link
Contributor

What you are asking is to turn off the internal logging events?

@arb
Copy link
Contributor Author

arb commented Oct 30, 2014

No I want request.log() to do either of these things:

  1. emit a different event ("requestlog" for example) instead of "request" when request.log() is called. (breaking change)
  2. emit an additional event ("requestlog" for example) in addition to "request" when request.log() is called. (non-breaking change)

Currently there isn't a clean way to capture "request" events that originate from request.log() if clients are only interested in that single event and not all of the "request" events.

@hueniverse
Copy link
Contributor

Everything calls request.log(). I think you are trying to make a difference between the ones called by hapi internally and the ones called by the user.

@arb
Copy link
Contributor Author

arb commented Oct 31, 2014

Yeah it would be nice to not have to rely on tags to figure out the user ones... what about leaving request.log alone and add request.message() (or something) which could call request.log but with something indicating it was user initiated and either raise an additional event or send something in the payload that could be reliably filtered with?

@nlf
Copy link
Member

nlf commented Oct 31, 2014

For my own logging, I've been checking for the 'hapi' tag in request log events and assuming those are internal and filtering them out.. It's not perfect, but it's done most of the job.

That said, having a different event would be super useful rather than relying on filtering based on random assumptions made about internal messages.

@hueniverse hueniverse self-assigned this Nov 14, 2014
@hueniverse hueniverse added this to the 8.0.0 milestone Nov 14, 2014
@hueniverse hueniverse added the breaking changes Change that can breaking existing code label Nov 19, 2014
@Marsup Marsup added feature New functionality or improvement and removed request labels Sep 20, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

4 participants