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

Backend logging #535

Merged
merged 1 commit into from May 16, 2019
Merged

Backend logging #535

merged 1 commit into from May 16, 2019

Conversation

izri16
Copy link
Contributor

@izri16 izri16 commented May 15, 2019

No description provided.

@izri16 izri16 requested a review from ppershing May 15, 2019 14:16
@izri16 izri16 self-assigned this May 15, 2019
@nicarq nicarq temporarily deployed to seiza-website-pr-535 May 15, 2019 14:16 Inactive
@izri16 izri16 changed the title WIP: Backend logging Backend logging May 15, 2019
@@ -61,6 +62,20 @@ async function _new(req, res) {
ApolloServer.prototype.createGraphQLServerOptions = _new
// end of workaround

const getLogger = (uuid) => {
const logToJSON = (v) => console.log(JSON.stringify(v, null, 2)) // eslint-disable-line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log? I was hoping we get something better, like winston. Although I haven't investigated further, I saw this discussion apollographql/apollo-server#1264 @ppershing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add it in subsequent PR?

@@ -69,6 +84,7 @@ const server = new ApolloServer({
},
// TODO: replace with production-ready logger
formatError: (error: GraphQLError): any => {
// TODO: how can we get Context here, so that we can connect error to request uuid?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think second parameter to this function is context

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will try,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is not, not according to docs, and when I tried I got undefined here.

Copy link
Contributor

@bigamasta bigamasta May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, Okay, then it's probably second parameter to formatResponse I guess

@nicarq nicarq requested a deployment to seiza-website-pr-535 May 16, 2019 09:37 Abandoned
@izri16 izri16 merged commit 4ae67a4 into master May 16, 2019
@izri16 izri16 deleted the backend-logging branch May 16, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants