{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/mist/issues/502","repository_url":"https://api.github.com/repos/ethereum/mist","labels_url":"https://api.github.com/repos/ethereum/mist/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/mist/issues/502/comments","events_url":"https://api.github.com/repos/ethereum/mist/issues/502/events","html_url":"https://github.com/ethereum/mist/pull/502","id":149039766,"number":502,"title":"log4js integration","user":{"login":"hiddentao","id":266594,"avatar_url":"https://avatars.githubusercontent.com/u/266594?v=3","gravatar_id":"","url":"https://api.github.com/users/hiddentao","html_url":"https://github.com/hiddentao","followers_url":"https://api.github.com/users/hiddentao/followers","following_url":"https://api.github.com/users/hiddentao/following{/other_user}","gists_url":"https://api.github.com/users/hiddentao/gists{/gist_id}","starred_url":"https://api.github.com/users/hiddentao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiddentao/subscriptions","organizations_url":"https://api.github.com/users/hiddentao/orgs","repos_url":"https://api.github.com/users/hiddentao/repos","events_url":"https://api.github.com/users/hiddentao/events{/privacy}","received_events_url":"https://api.github.com/users/hiddentao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-18T04:32:14Z","updated_at":"2016-04-19T02:33:47Z","closed_at":"2016-04-18T07:55:50Z","pull_request":{"url":"https://api.github.com/repos/ethereum/mist/pulls/502","html_url":"https://github.com/ethereum/mist/pull/502","diff_url":"https://github.com/ethereum/mist/pull/502.diff","patch_url":"https://github.com/ethereum/mist/pull/502.patch"},"body":"This replaces `console.log` calls with a [log4js](https://github.com/nomiddlename/log4js-node) integration and adds two command-line flags (`--loglevel` and `--logfile`) to be able to customize logging verbosity at runtime.\r\n\r\n<img width=\"1111\" alt=\"screen shot 2016-04-18 at 12 26 45\" src=\"https://cloud.githubusercontent.com/assets/266594/14593728/db98be8e-0560-11e6-9c56-51d23abac4b8.png\">\r\n\r\nBenefits:\r\n* Console output is now timestamped and categorized - with the ability to customize the format in a single place (the `logger.js` file). We could also add a CLI arg to override the pattern if deemed necessary.\r\n* We can now add debug and trace logging in many more parts of the app without automatically clogging up the console output, yet retaining the ability to show these logs by setting the right CLI argument.\r\n* We can set the logging threshold using `--loglevel <level>`. Possible values are `trace`, `debug`, `info`, `warn`, `error`. Default is `info`.\r\n* We can have log4js log to a file using the `--logfile <path to file>` arg.\r\n* Log4js output formatter automatically handles things like `Error` objects well.\r\n\r\n\r\nI haven't added this logging to the Meteor \"interface\" app yet but there's no reason we can't do that."},"comment":{"url":"https://api.github.com/repos/ethereum/mist/issues/comments/211699609","html_url":"https://github.com/ethereum/mist/pull/502#issuecomment-211699609","issue_url":"https://api.github.com/repos/ethereum/mist/issues/502","id":211699609,"user":{"login":"hiddentao","id":266594,"avatar_url":"https://avatars.githubusercontent.com/u/266594?v=3","gravatar_id":"","url":"https://api.github.com/users/hiddentao","html_url":"https://github.com/hiddentao","followers_url":"https://api.github.com/users/hiddentao/followers","following_url":"https://api.github.com/users/hiddentao/following{/other_user}","gists_url":"https://api.github.com/users/hiddentao/gists{/gist_id}","starred_url":"https://api.github.com/users/hiddentao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiddentao/subscriptions","organizations_url":"https://api.github.com/users/hiddentao/orgs","repos_url":"https://api.github.com/users/hiddentao/repos","events_url":"https://api.github.com/users/hiddentao/events{/privacy}","received_events_url":"https://api.github.com/users/hiddentao/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T02:33:47Z","updated_at":"2016-04-19T02:33:47Z","body":"Looks like Meteor 1.3 has built-in support for NPM modules -> https://github.com/meteorhacks/npm\r\n\r\nSo it would be trivial to include log4js into the Meteor app (once we've upgraded Meteor of course) and then we would just need to write a custom [appender](https://github.com/nomiddlename/log4js-node/wiki/Appenders) which sends the log data to the IPC back-end. \r\n\r\nI'd like to give this a go - I think it would be very useful."}}