{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/2246","repository_url":"https://api.github.com/repos/couchbase/sync_gateway","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/2246/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/2246/comments","events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/2246/events","html_url":"https://github.com/couchbase/sync_gateway/issues/2246","id":202938429,"number":2246,"title":"logFilePath for windows paths need double slash","user":{"login":"raghusarangapani","id":24398601,"avatar_url":"https://avatars.githubusercontent.com/u/24398601?v=3","gravatar_id":"","url":"https://api.github.com/users/raghusarangapani","html_url":"https://github.com/raghusarangapani","followers_url":"https://api.github.com/users/raghusarangapani/followers","following_url":"https://api.github.com/users/raghusarangapani/following{/other_user}","gists_url":"https://api.github.com/users/raghusarangapani/gists{/gist_id}","starred_url":"https://api.github.com/users/raghusarangapani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghusarangapani/subscriptions","organizations_url":"https://api.github.com/users/raghusarangapani/orgs","repos_url":"https://api.github.com/users/raghusarangapani/repos","events_url":"https://api.github.com/users/raghusarangapani/events{/privacy}","received_events_url":"https://api.github.com/users/raghusarangapani/received_events","type":"User","site_admin":false},"labels":[{"id":110668780,"url":"https://api.github.com/repos/couchbase/sync_gateway/labels/P1:%20high","name":"P1: high","color":"e11d21","default":false},{"id":479307913,"url":"https://api.github.com/repos/couchbase/sync_gateway/labels/ready","name":"ready","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"ajres","id":7745210,"avatar_url":"https://avatars.githubusercontent.com/u/7745210?v=3","gravatar_id":"","url":"https://api.github.com/users/ajres","html_url":"https://github.com/ajres","followers_url":"https://api.github.com/users/ajres/followers","following_url":"https://api.github.com/users/ajres/following{/other_user}","gists_url":"https://api.github.com/users/ajres/gists{/gist_id}","starred_url":"https://api.github.com/users/ajres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajres/subscriptions","organizations_url":"https://api.github.com/users/ajres/orgs","repos_url":"https://api.github.com/users/ajres/repos","events_url":"https://api.github.com/users/ajres/events{/privacy}","received_events_url":"https://api.github.com/users/ajres/received_events","type":"User","site_admin":false},"assignees":[{"login":"ajres","id":7745210,"avatar_url":"https://avatars.githubusercontent.com/u/7745210?v=3","gravatar_id":"","url":"https://api.github.com/users/ajres","html_url":"https://github.com/ajres","followers_url":"https://api.github.com/users/ajres/followers","following_url":"https://api.github.com/users/ajres/following{/other_user}","gists_url":"https://api.github.com/users/ajres/gists{/gist_id}","starred_url":"https://api.github.com/users/ajres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajres/subscriptions","organizations_url":"https://api.github.com/users/ajres/orgs","repos_url":"https://api.github.com/users/ajres/repos","events_url":"https://api.github.com/users/ajres/events{/privacy}","received_events_url":"https://api.github.com/users/ajres/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/couchbase/sync_gateway/milestones/19","html_url":"https://github.com/couchbase/sync_gateway/milestone/19","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/milestones/19/labels","id":1807674,"number":19,"title":"1.4.0","description":"","creator":{"login":"adamcfraser","id":8866453,"avatar_url":"https://avatars.githubusercontent.com/u/8866453?v=3","gravatar_id":"","url":"https://api.github.com/users/adamcfraser","html_url":"https://github.com/adamcfraser","followers_url":"https://api.github.com/users/adamcfraser/followers","following_url":"https://api.github.com/users/adamcfraser/following{/other_user}","gists_url":"https://api.github.com/users/adamcfraser/gists{/gist_id}","starred_url":"https://api.github.com/users/adamcfraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamcfraser/subscriptions","organizations_url":"https://api.github.com/users/adamcfraser/orgs","repos_url":"https://api.github.com/users/adamcfraser/repos","events_url":"https://api.github.com/users/adamcfraser/events{/privacy}","received_events_url":"https://api.github.com/users/adamcfraser/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":58,"state":"open","created_at":"2016-06-03T18:12:47Z","updated_at":"2017-02-03T02:15:19Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2017-01-24T20:59:45Z","updated_at":"2017-02-03T03:52:03Z","closed_at":null,"body":"### Sync Gateway version\r\n1.4-42 x86_64\r\n\r\n### Operating system\r\nWin 10.\r\n\r\n### Config file\r\n```\r\n{\r\n  \"logging\": {\r\n    \"default\": {\r\n      \"logFilePath\": \"C:\\Program Files (x86)\\Couchbase\\var\\lib\\couchbase\\logs\\sync_gateway_error.log\",\r\n      \"logKeys\": [\"*\"],\r\n      \"logLevel\": \"debug\",\r\n      \"rotation\": {\r\n        \"maxsize\": 1,\r\n        \"maxage\": 1,\r\n        \"maxbackups\": 2,\r\n        \"localtime\": true\r\n      }\r\n    }\r\n  },\r\n  \"databases\": {\r\n    \"db\": {\r\n      \"server\": \"http://<Server_IP>:8091/\",\r\n      \"bucket\": \"default\",\r\n      \"users\": {\"GUEST\": {\"disabled\": false,\"admin_channels\": [\"*\"]}}\r\n    }\r\n  }\r\n}\r\n```\r\n### Steps to reproduce\r\n1.  Copy paste the above config file to serviceconfig.json\r\n2. Restart sync gateway\r\n3. Check C:\\\\Program Files (x86)\\\\Couchbase\\\\var\\\\lib\\\\couchbase\\\\logs\\\\sync_gateway_error.log for errors\r\n\r\n### Expected behavior\r\n- Windows paths should be accepted without workarounds.\r\n\r\n### Actual behavior\r\n- Valid windows paths cannot be set, \r\n\r\n```\"logFilePath\": \"C:\\Program Files (x86)\\Couchbase\\var\\lib\\couchbase\\logs\\sync_gateway_error.log\", ``` \r\n\r\nthrows an error\r\n\r\n```2017-01-23T11:56:31.112-08:00 FATAL: Error reading config file C:\\Program Files (x86)\\Couchbase\\serviceconfig.json: invalid character 'P' in string escape code -- rest.ParseCommandLine() at config.go:504,```\r\n\r\nIf I enclose the path in single quotes, I see an error\r\n\r\n``` 2017-01-23T11:55:55.079-08:00 FATAL: Error reading config file C:\\Program Files (x86)\\Couchbase\\serviceconfig.json: invalid character ''' looking for beginning of value -- rest.ParseCommandLine() at config.go:504 ```\r\n\r\n### Workaround:\r\n\r\nFrom the log message, it looks like we are assuming \\ to be a regex escape sequence\r\nSetting it to a path with double slash (\\\\\\\\) works fine.\r\n\r\n```\"logFilePath\": \"C:\\\\Program Files (x86)\\\\Couchbase\\\\var\\\\lib\\\\couchbase\\\\logs\\\\sync_gateway_error.log\" ```\r\n\r\nand the corresponding log\r\n\r\n```2017-01-23 12:01:50.284971 I | Log entries will be written to the file C:\\Program Files (x86)\\Couchbase\\var\\lib\\couchbase\\logs\\sync_gateway_error.log```"},"comment":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments/277158239","html_url":"https://github.com/couchbase/sync_gateway/issues/2246#issuecomment-277158239","issue_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/2246","id":277158239,"user":{"login":"ajres","id":7745210,"avatar_url":"https://avatars.githubusercontent.com/u/7745210?v=3","gravatar_id":"","url":"https://api.github.com/users/ajres","html_url":"https://github.com/ajres","followers_url":"https://api.github.com/users/ajres/followers","following_url":"https://api.github.com/users/ajres/following{/other_user}","gists_url":"https://api.github.com/users/ajres/gists{/gist_id}","starred_url":"https://api.github.com/users/ajres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajres/subscriptions","organizations_url":"https://api.github.com/users/ajres/orgs","repos_url":"https://api.github.com/users/ajres/repos","events_url":"https://api.github.com/users/ajres/events{/privacy}","received_events_url":"https://api.github.com/users/ajres/received_events","type":"User","site_admin":false},"created_at":"2017-02-03T03:52:03Z","updated_at":"2017-02-03T03:52:03Z","body":"The supported logFilePath formats for Windows have been added to the logRotation docs in a PR here: https://github.com/couchbaselabs/couchbase-mobile-portal/pull/543"}}
{"actor":{"display_login":"ajres"}}