{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/61161998","id":61161998,"diff_hunk":"@@ -38,3 +38,14 @@ log4j.logger.parquet=ERROR\n # SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support\n log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL\n log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR\n+\n+# SPARK-14754: Metrics as logs are not coming through slf4j.\n+#log4j.logger.org.apache.spark.metrics=INFO, metricFileAppender\n+#log4j.additivity.org.apache.spark.metrics=true\n+\n+#log4j.appender.metricFileAppender=org.apache.log4j.RollingFileAppender\n+#log4j.appender.metricFileAppender.File=${logFilePath}\n+#log4j.appender.metricFileAppender.MaxFileSize=10MB","path":"conf/log4j.properties.template","position":11,"original_position":11,"commit_id":"7f961e8a11fa26ab95848325bc61c09b12a3747d","original_commit_id":"5a437a12fb0c6cfdd7119d63bebc3f3f2c935d5f","user":{"login":"mihir6692","id":11543992,"avatar_url":"https://avatars.githubusercontent.com/u/11543992?v=3","gravatar_id":"","url":"https://api.github.com/users/mihir6692","html_url":"https://github.com/mihir6692","followers_url":"https://api.github.com/users/mihir6692/followers","following_url":"https://api.github.com/users/mihir6692/following{/other_user}","gists_url":"https://api.github.com/users/mihir6692/gists{/gist_id}","starred_url":"https://api.github.com/users/mihir6692/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihir6692/subscriptions","organizations_url":"https://api.github.com/users/mihir6692/orgs","repos_url":"https://api.github.com/users/mihir6692/repos","events_url":"https://api.github.com/users/mihir6692/events{/privacy}","received_events_url":"https://api.github.com/users/mihir6692/received_events","type":"User","site_admin":false},"body":"For Slf4jSink.scala :-\n\nIts not about class path or class level in package. It is just a name. Ex.\nIf you keep name like `Spark.log4j`, it would still work. ( and use the\nsame `Spark.log4j` in log4j.properties).  So it won't matter even if we\nmove class to some other folder or package.\n\nFor log4j.properties :-\n\nMain reason to use new appenders is to get metrics in separate file which\nwill reduce complexity if someone one wants to parse metric.\n\nIt would be better to use new appender so when you disable root logger ,\nyou will only disable application logs, not the metrics logs. ( for more\ndetailed and through explanation :- http://stackoverflow.com/a/23323046 )\n\nOn Tue, Apr 26, 2016 at 4:27 PM, Sean Owen <notifications@github.com> wrote:\n\n> In conf/log4j.properties.template\n> <https://github.com/apache/spark/pull/12697#discussion_r61066147>:\n>\n> > @@ -38,3 +38,14 @@ log4j.logger.parquet=ERROR\n> >  # SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support\n> >  log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL\n> >  log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR\n> > +\n> > +# SPARK-14754: Metrics as logs are not coming through slf4j.\n> > +#log4j.logger.org.apache.spark.metrics=INFO, metricFileAppender\n> > +#log4j.additivity.org.apache.spark.metrics=true\n> > +\n> > +#log4j.appender.metricFileAppender=org.apache.log4j.RollingFileAppender\n> > +#log4j.appender.metricFileAppender.File=${logFilePath}\n> > +#log4j.appender.metricFileAppender.MaxFileSize=10MB\n>\n> I still don't think this has been addressed. It shouldn't need a new\n> appender, right?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/apache/spark/pull/12697/files/5a437a12fb0c6cfdd7119d63bebc3f3f2c935d5f#r61066147>\n>\n\n\n\n-- \nMihir Monani\n(+91)-9429473434\n","created_at":"2016-04-26T20:52:01Z","updated_at":"2016-04-26T20:52:01Z","html_url":"https://github.com/apache/spark/pull/12697#discussion_r61161998","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/12697","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/61161998"},"html":{"href":"https://github.com/apache/spark/pull/12697#discussion_r61161998"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/12697"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12697","id":67845687,"html_url":"https://github.com/apache/spark/pull/12697","diff_url":"https://github.com/apache/spark/pull/12697.diff","patch_url":"https://github.com/apache/spark/pull/12697.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/12697","number":12697,"state":"open","locked":false,"title":"[SPARK-14754][SPARK CORE] Metrics as logs are not coming through slf4j","user":{"login":"mihir6692","id":11543992,"avatar_url":"https://avatars.githubusercontent.com/u/11543992?v=3","gravatar_id":"","url":"https://api.github.com/users/mihir6692","html_url":"https://github.com/mihir6692","followers_url":"https://api.github.com/users/mihir6692/followers","following_url":"https://api.github.com/users/mihir6692/following{/other_user}","gists_url":"https://api.github.com/users/mihir6692/gists{/gist_id}","starred_url":"https://api.github.com/users/mihir6692/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihir6692/subscriptions","organizations_url":"https://api.github.com/users/mihir6692/orgs","repos_url":"https://api.github.com/users/mihir6692/repos","events_url":"https://api.github.com/users/mihir6692/events{/privacy}","received_events_url":"https://api.github.com/users/mihir6692/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nTwo changes need to be done : \r\n1) Slf4jsink.scala \r\n        Added class name for logging. (Reference : https://dropwizard.github.io/metrics/3.1.0/manual/core/#man-core-reporters-slf4j )\r\n\r\n2) log4j.properties.template\r\n        Added log configuration in log4j.properties.template for in support of above changes.\r\n\r\n## How was this patch tested?\r\n\r\nIt is tested with manual testing. I build spark with make-distribution.sh and then tried few example job to print Metrics in log files.\r\n\r\n","created_at":"2016-04-26T08:32:04Z","updated_at":"2016-04-26T20:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b201911653770eb19d422ab6679372441b9b8e32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/12697/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/12697/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/12697/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/7f961e8a11fa26ab95848325bc61c09b12a3747d","head":{"label":"mihir6692:master","ref":"master","sha":"7f961e8a11fa26ab95848325bc61c09b12a3747d","user":{"login":"mihir6692","id":11543992,"avatar_url":"https://avatars.githubusercontent.com/u/11543992?v=3","gravatar_id":"","url":"https://api.github.com/users/mihir6692","html_url":"https://github.com/mihir6692","followers_url":"https://api.github.com/users/mihir6692/followers","following_url":"https://api.github.com/users/mihir6692/following{/other_user}","gists_url":"https://api.github.com/users/mihir6692/gists{/gist_id}","starred_url":"https://api.github.com/users/mihir6692/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihir6692/subscriptions","organizations_url":"https://api.github.com/users/mihir6692/orgs","repos_url":"https://api.github.com/users/mihir6692/repos","events_url":"https://api.github.com/users/mihir6692/events{/privacy}","received_events_url":"https://api.github.com/users/mihir6692/received_events","type":"User","site_admin":false},"repo":{"id":57110970,"name":"spark","full_name":"mihir6692/spark","owner":{"login":"mihir6692","id":11543992,"avatar_url":"https://avatars.githubusercontent.com/u/11543992?v=3","gravatar_id":"","url":"https://api.github.com/users/mihir6692","html_url":"https://github.com/mihir6692","followers_url":"https://api.github.com/users/mihir6692/followers","following_url":"https://api.github.com/users/mihir6692/following{/other_user}","gists_url":"https://api.github.com/users/mihir6692/gists{/gist_id}","starred_url":"https://api.github.com/users/mihir6692/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihir6692/subscriptions","organizations_url":"https://api.github.com/users/mihir6692/orgs","repos_url":"https://api.github.com/users/mihir6692/repos","events_url":"https://api.github.com/users/mihir6692/events{/privacy}","received_events_url":"https://api.github.com/users/mihir6692/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mihir6692/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/mihir6692/spark","forks_url":"https://api.github.com/repos/mihir6692/spark/forks","keys_url":"https://api.github.com/repos/mihir6692/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mihir6692/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mihir6692/spark/teams","hooks_url":"https://api.github.com/repos/mihir6692/spark/hooks","issue_events_url":"https://api.github.com/repos/mihir6692/spark/issues/events{/number}","events_url":"https://api.github.com/repos/mihir6692/spark/events","assignees_url":"https://api.github.com/repos/mihir6692/spark/assignees{/user}","branches_url":"https://api.github.com/repos/mihir6692/spark/branches{/branch}","tags_url":"https://api.github.com/repos/mihir6692/spark/tags","blobs_url":"https://api.github.com/repos/mihir6692/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mihir6692/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mihir6692/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/mihir6692/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mihir6692/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/mihir6692/spark/languages","stargazers_url":"https://api.github.com/repos/mihir6692/spark/stargazers","contributors_url":"https://api.github.com/repos/mihir6692/spark/contributors","subscribers_url":"https://api.github.com/repos/mihir6692/spark/subscribers","subscription_url":"https://api.github.com/repos/mihir6692/spark/subscription","commits_url":"https://api.github.com/repos/mihir6692/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/mihir6692/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/mihir6692/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/mihir6692/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/mihir6692/spark/contents/{+path}","compare_url":"https://api.github.com/repos/mihir6692/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mihir6692/spark/merges","archive_url":"https://api.github.com/repos/mihir6692/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mihir6692/spark/downloads","issues_url":"https://api.github.com/repos/mihir6692/spark/issues{/number}","pulls_url":"https://api.github.com/repos/mihir6692/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/mihir6692/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/mihir6692/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mihir6692/spark/labels{/name}","releases_url":"https://api.github.com/repos/mihir6692/spark/releases{/id}","deployments_url":"https://api.github.com/repos/mihir6692/spark/deployments","created_at":"2016-04-26T08:22:57Z","updated_at":"2016-04-26T08:23:19Z","pushed_at":"2016-04-26T10:23:43Z","git_url":"git://github.com/mihir6692/spark.git","ssh_url":"git@github.com:mihir6692/spark.git","clone_url":"https://github.com/mihir6692/spark.git","svn_url":"https://github.com/mihir6692/spark","homepage":null,"size":166416,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"2a5c930790b4b92674e74f093380d89a9a625552","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-04-26T20:28:01Z","pushed_at":"2016-04-26T20:36:25Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":471307,"stargazers_count":8301,"watchers_count":8301,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7682,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":433,"forks":7682,"open_issues":433,"watchers":8301,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/12697"},"html":{"href":"https://github.com/apache/spark/pull/12697"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/12697"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/12697/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/12697/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/12697/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/7f961e8a11fa26ab95848325bc61c09b12a3747d"}}}}