{"action":"created","issue":{"url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook/issues/8","repository_url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook","labels_url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook/issues/8/comments","events_url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook/issues/8/events","html_url":"https://github.com/gemnasium/logrus-graylog-hook/issues/8","id":157900246,"number":8,"title":"race condition on data map","user":{"login":"dreyinger","id":1956109,"avatar_url":"https://avatars.githubusercontent.com/u/1956109?v=3","gravatar_id":"","url":"https://api.github.com/users/dreyinger","html_url":"https://github.com/dreyinger","followers_url":"https://api.github.com/users/dreyinger/followers","following_url":"https://api.github.com/users/dreyinger/following{/other_user}","gists_url":"https://api.github.com/users/dreyinger/gists{/gist_id}","starred_url":"https://api.github.com/users/dreyinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreyinger/subscriptions","organizations_url":"https://api.github.com/users/dreyinger/orgs","repos_url":"https://api.github.com/users/dreyinger/repos","events_url":"https://api.github.com/users/dreyinger/events{/privacy}","received_events_url":"https://api.github.com/users/dreyinger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-01T12:59:16Z","updated_at":"2016-06-03T13:42:04Z","closed_at":null,"body":"Hey, the following code produces a race condition in graylog_hook.go line 146 because there is a read access on the Data map outside the Hook interfaces Fire function.\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"time\"\r\n\r\n\t\"gopkg.in/gemnasium/logrus-graylog-hook.v1\"\r\n\r\n\t\"github.com/Sirupsen/logrus\"\r\n)\r\n\r\nfunc main() {\r\n\tlog := logrus.New()\r\n\thook := graylog.NewAsyncGraylogHook(\"localhost:12201\", \"facility\", map[string]interface{}{\"this\": \"is logged every time\"})\r\n\tdefer hook.Flush()\r\n\tlog.Hooks.Add(hook)\r\n\r\n\tgo func() {\r\n\t\tlog.WithFields(logrus.Fields{\"msg\": \"test1\"}).Info(\"test1\")\r\n\t}()\r\n\r\n\tlog.WithFields(logrus.Fields{\"msg\": \"test2\"}).Info(\"test2\")\r\n\r\n\tch := time.Tick(time.Second * 1)\r\n\r\n\t<-ch\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook/issues/comments/223581803","html_url":"https://github.com/gemnasium/logrus-graylog-hook/issues/8#issuecomment-223581803","issue_url":"https://api.github.com/repos/gemnasium/logrus-graylog-hook/issues/8","id":223581803,"user":{"login":"gravis","id":12752,"avatar_url":"https://avatars.githubusercontent.com/u/12752?v=3","gravatar_id":"","url":"https://api.github.com/users/gravis","html_url":"https://github.com/gravis","followers_url":"https://api.github.com/users/gravis/followers","following_url":"https://api.github.com/users/gravis/following{/other_user}","gists_url":"https://api.github.com/users/gravis/gists{/gist_id}","starred_url":"https://api.github.com/users/gravis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravis/subscriptions","organizations_url":"https://api.github.com/users/gravis/orgs","repos_url":"https://api.github.com/users/gravis/repos","events_url":"https://api.github.com/users/gravis/events{/privacy}","received_events_url":"https://api.github.com/users/gravis/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T13:42:04Z","updated_at":"2016-06-03T13:42:04Z","body":"Thanks! I will take a look today\r\n"}}
{"actor":{"display_login":"gravis"}}