{"action":"created","issue":{"url":"https://api.github.com/repos/sstur/nodeftpd/issues/91","repository_url":"https://api.github.com/repos/sstur/nodeftpd","labels_url":"https://api.github.com/repos/sstur/nodeftpd/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/sstur/nodeftpd/issues/91/comments","events_url":"https://api.github.com/repos/sstur/nodeftpd/issues/91/events","html_url":"https://github.com/sstur/nodeftpd/pull/91","id":133476374,"number":91,"title":"Better logging","user":{"login":"oleksiyk","id":2870352,"avatar_url":"https://avatars.githubusercontent.com/u/2870352?v=3","gravatar_id":"","url":"https://api.github.com/users/oleksiyk","html_url":"https://github.com/oleksiyk","followers_url":"https://api.github.com/users/oleksiyk/followers","following_url":"https://api.github.com/users/oleksiyk/following{/other_user}","gists_url":"https://api.github.com/users/oleksiyk/gists{/gist_id}","starred_url":"https://api.github.com/users/oleksiyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleksiyk/subscriptions","organizations_url":"https://api.github.com/users/oleksiyk/orgs","repos_url":"https://api.github.com/users/oleksiyk/repos","events_url":"https://api.github.com/users/oleksiyk/events{/privacy}","received_events_url":"https://api.github.com/users/oleksiyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-13T21:41:43Z","updated_at":"2016-02-14T00:33:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sstur/nodeftpd/pulls/91","html_url":"https://github.com/sstur/nodeftpd/pull/91","diff_url":"https://github.com/sstur/nodeftpd/pull/91.diff","patch_url":"https://github.com/sstur/nodeftpd/pull/91.patch"},"body":"This makes nodeftpd to log messages like this:\r\n\r\n![log-1](http://oleksiy.sirv.com/github/log1.png?format=jpg)\r\n![log-2](http://oleksiy.sirv.com/github/log2.png?format=jpg)\r\n\r\nEach message consists of 5 space separated fields:\r\n- date time in ISO8601 format (YYYY-MM-DDTHH:mm:ss.sssZ)\r\n- message level (ERROR, WARN, DEBUG, TRACE, INFO)\r\n- remote IP or '-'\r\n- authenticated user or '-'\r\n- free text message \r\n\r\nMessages are logged in color to TTY and without any color escape sequences when stdout/stderr is redirected to file.\r\n\r\nSeveral new options added:\r\n\r\n- `ttyColors`: boolean, set to `false` to force disable coloured output\r\n- `logFunction`: function, overwrite default function used to log messages. Receives 4 arguments: level, remote ip, authenticated user, message.\r\n\r\n`logLevel` option remains the same: from 0 (just errors) to 4 (trace)\r\n\r\nI've also used [sinon](http://sinonjs.org) to verify logged messages in some tests instead of old method:\r\nhttps://github.com/oleksiyk/nodeftpd/commit/df873e561687adc747125c232722d56111a9ff40#diff-51ecdc1506ecf5aaebb57c019653fbe6L124\r\n\r\nLogging level can also be redefined with NODEFTPD_LOG_LEVEL environment variable."},"comment":{"url":"https://api.github.com/repos/sstur/nodeftpd/issues/comments/183780388","html_url":"https://github.com/sstur/nodeftpd/pull/91#issuecomment-183780388","issue_url":"https://api.github.com/repos/sstur/nodeftpd/issues/91","id":183780388,"user":{"login":"oleksiyk","id":2870352,"avatar_url":"https://avatars.githubusercontent.com/u/2870352?v=3","gravatar_id":"","url":"https://api.github.com/users/oleksiyk","html_url":"https://github.com/oleksiyk","followers_url":"https://api.github.com/users/oleksiyk/followers","following_url":"https://api.github.com/users/oleksiyk/following{/other_user}","gists_url":"https://api.github.com/users/oleksiyk/gists{/gist_id}","starred_url":"https://api.github.com/users/oleksiyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleksiyk/subscriptions","organizations_url":"https://api.github.com/users/oleksiyk/orgs","repos_url":"https://api.github.com/users/oleksiyk/repos","events_url":"https://api.github.com/users/oleksiyk/events{/privacy}","received_events_url":"https://api.github.com/users/oleksiyk/received_events","type":"User","site_admin":false},"created_at":"2016-02-14T00:33:08Z","updated_at":"2016-02-14T00:33:08Z","body":"Ok, let me know what you decide. I will adapt this one for ES6 branch or create new PR. "}}