Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Feature Enhancement: Avoid request started log lines #1

Open
joelpresence opened this issue May 27, 2017 · 3 comments
Open

Feature Enhancement: Avoid request started log lines #1

joelpresence opened this issue May 27, 2017 · 3 comments

Comments

@joelpresence
Copy link

Hi,

Thanks for making this great library available!

We are using it and liking it. However, we don't need both a "request started" and "request complete" JSON log line to be logged, we only need the "request complete" line logged.

Is there an easy way to turn off the "request started" log emission? It's being created in NewLogEntry and maybe we could add a flag to supress this?

# Currently, we get two log lines per request in chi
{ ... "msg": "request started" ... }
{ ... "msg": "request complete" ... }

#We want only one log line per request in chi
{ ... "msg": "request complete" ... }

I could also fork this repo, but I'd prefer not to. Is there a reason for the "request started" log line? Given that the "request complete" log entry catches the interesting data wrt timing, and other fields we might add in our own code, I don't see the need for the "request started" line. It is slowing down our code noticeably and we are paying a third party log hosting company by the GB for hosting our logs, so we want to keep them as small as possible ...

The panic middleware will catch any panics, so I don't see any need for the "request started" line.

Any ideas?

Thanks!

@joelpresence
Copy link
Author

@pkieltyka any feedback? Thanks!

@VojtechVitek
Copy link
Collaborator

I agree with the proposal. @joelpresence We accept Pull Requests!

@joelpresence
Copy link
Author

@VojtechVitek see #2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants