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

logging-bunyan: HttpRequest support #2325

Merged
merged 3 commits into from
May 25, 2017

Conversation

ofrobots
Copy link
Contributor

@ofrobots ofrobots commented May 22, 2017

If the bunyan provided metadata includes a httpRequest property, format
that as the HttpRequest message. This allows Stackdriver logging to
format request logs nicely.

Fixes: #2251

EDIT: note that this is semver-major.

If the bunyan provided metadata includes a httpRequest property, format
that as the HttpRequest message. This allows Stackdriver logging to
format request logs nicely.

Fixes: googleapis#2251
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 22, 2017
@@ -66,7 +66,29 @@ var loggingBunyan = require('@google-cloud/logging-bunyan')({
// ...you're good to go!
```

## Formatting Request Logs

To format your request logs you can provide a `httpRequest` property on the bunyan metadata you provide along with the log message. We will format this as the [`HttpRequest`][http-request-message] message and Stackdriver logging will show this as a request log. Example:

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.0e-05%) to 99.925% when pulling f224d05 on ofrobots:bunyan-http-request into d152416 on GoogleCloudPlatform:master.

@ofrobots
Copy link
Contributor Author

CI is green now. PTAL.

@stephenplusplus stephenplusplus merged commit 1a0b73a into googleapis:master May 25, 2017
@stephenplusplus
Copy link
Contributor

Cool, thanks!

@ofrobots ofrobots deleted the bunyan-http-request branch May 25, 2017 17:28
ofrobots added a commit to ofrobots/google-cloud-node that referenced this pull request May 25, 2017
If the winston provided metadata includes a httpRequest property,
format that as the HttpRequest message. This allows Stackdriver logging
to format request logs nicely.

Ref: googleapis#2325
ofrobots added a commit to ofrobots/google-cloud-node that referenced this pull request May 25, 2017
If the winston provided metadata includes a httpRequest property,
format that as the HttpRequest message. This allows Stackdriver logging
to format request logs nicely.

Ref: googleapis#2325
@travi
Copy link

travi commented May 26, 2017

thanks so much for this update! is there a release planned soon so i can give it a shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging-bunyan cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants