{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/915","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/915/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/915/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/915/events","html_url":"https://github.com/cockroachdb/cockroach/pull/915","id":73163258,"number":915,"title":"[DONOTMERGE] structured logging experiments","user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/PTAL","name":"PTAL","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-05T00:14:55Z","updated_at":"2015-05-07T21:38:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/915","html_url":"https://github.com/cockroachdb/cockroach/pull/915","diff_url":"https://github.com/cockroachdb/cockroach/pull/915.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/915.patch"},"body":"in #532 we were talking about moving to a structured log format, the idea being that mostly we will have machines consuming our log messages (or at the very least, filtering and storing them).\r\n\r\nthe hope is to be able to do this nicely using `context.Context` which is passed along with client requests and eventually logged through a handler that inspects the context, along with a message.\r\n\r\nDisclaimer: Nothing below is final, I'm just putting this up to generate some discussion and less refactoring work after. In particular the output format is completely dummy. All that matters is having a useful API that's fun to log with (and that doesn't weigh down the system).\r\n\r\nin this (not yet) PR I tried this out with a few log entries from within `Store` (which is for now the canonical entry point; really we want to get all the way back to where the clients enter the system, but for now the senders and some other things are in the way).\r\n\r\nUnfortunately it's very tedious to use a Context directly, as there's only a `context.WithValue` package level function, which makes adding values cumbersome. I worked around this by adding a dummy struct that does nothing more but embed a context.Context and adds an `Add` method as sugar.\r\n\r\nWe might also want to have different log formats (terminal vs. json vs. maybe json text sequences or ...) so we should think about what we want for a minute here."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/100026886","html_url":"https://github.com/cockroachdb/cockroach/pull/915#issuecomment-100026886","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/915","id":100026886,"user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T21:38:17Z","updated_at":"2015-05-07T21:38:17Z","body":"glog it is. The other one needs work to get the file handling right. It has handler-based output but I can turn glog into something that's just used for logging plain strings messages to stderr and/or files pretty quickly and any other output we will wrap around anyways.\r\nVDepth is trivial.\r\nFlag handling is also easy, I've removed the dependency to flag already in my local fork.\r\n\r\nWhere should the fork go? `cockroachdb/glog`?"}}