-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add query/mutation logging in glog V=3. #5024
Conversation
Needs doc. However new section about logs can be handled as part of DGRAPH-1165 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, just a question regarding new lines in the query.
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @danielmai and @manishrjain)
edgraph/server.go, line 771 at r1 (raw file):
resp *api.Response, rerr error) { if glog.V(3) { glog.Infof("Got a query: %+v", req)
will new lines in the query be printed as new lines in the log? If they do the query should be stripped of new lines to make sure the log is all in a single line.
edgraph/server.go, line 771 at r1 (raw file): Previously, martinmr (Martin Martinez Rivera) wrote…
Good point. Logs are always in a single line. Queries have
|
Closes #4944. By setting `-v=3` or `--vmodule=server=3`, then query/mutation logs will appear in the Alpha log. Examples: Query (has `query:` field) ``` I0324 15:41:27.464042 9642 server.go:771] Got a query: query:"{ q(func: has(counter.val)) { uid, val: counter.val }}" I0401 19:59:26.541382 16 server.go:771] Got a query: query:"query {\n getGQLSchema(func: type(dgraph.graphql)) {\n id : uid\n schema : dgraph.graphql.schema\n dgraph.uid : uid\n }\n}" read_only:true ``` Mutation (has `mutations:` field) ``` I0324 15:41:27.474000 9642 server.go:771] Got a query: start_ts:20006 mutations:<set_nquads:"<0x1> <counter.val> \"11\"^^<xs:int> ." commit_now:true > commit_now:true ```
Closes #4944. By setting `-v=3` or `--vmodule=server=3`, then query/mutation logs will appear in the Alpha log. Examples: Query (has `query:` field) ``` I0324 15:41:27.464042 9642 server.go:771] Got a query: query:"{ q(func: has(counter.val)) { uid, val: counter.val }}" I0401 19:59:26.541382 16 server.go:771] Got a query: query:"query {\n getGQLSchema(func: type(dgraph.graphql)) {\n id : uid\n schema : dgraph.graphql.schema\n dgraph.uid : uid\n }\n}" read_only:true ``` Mutation (has `mutations:` field) ``` I0324 15:41:27.474000 9642 server.go:771] Got a query: start_ts:20006 mutations:<set_nquads:"<0x1> <counter.val> \"11\"^^<xs:int> ." commit_now:true > commit_now:true ```
Closes #4944.
By setting
-v=3
or--vmodule=server=3
, then query/mutation logs will appear in the Alpha log.Example:
Query (has
query:
field)Mutation (has
mutations:
field)This change is