-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14754][SPARK CORE] Metrics as logs are not coming through slf4j #12697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
12d896c
5a437a1
032422b
7f961e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,9 @@ import java.util.concurrent.TimeUnit | |
|
|
||
| import com.codahale.metrics.{MetricRegistry, Slf4jReporter} | ||
|
|
||
| import org.slf4j.Logger | ||
| import org.slf4j.LoggerFactory | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should reorder imports. (Please see databricks/scala-style-guide#imports.)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (It would be great if you run
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will run "sbt scalastyle" before adding some commits in future. Regarding log4j.properties.template changes : - I have added configuration template for metrics as log in To Sean Owen :- I don't understand what you meant by "Why not the class name for the logger I gave generalize name for class as i didnt found any convention for it. On Tue, Apr 26, 2016 at 2:37 PM, Hyukjin Kwon notifications@github.com
Mihir Monani
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem you describe is that log messages aren't plumbed through to a logger, right? that shouldn't require changing appender config for log4j. Your JIRA says "Slf4jsink.scala should have class name for log4j to print metrics in log files" but your code has a package name.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok Sean, I understood your point. I will recreate pull request with more Should i close this pull request?? On Tue, Apr 26, 2016 at 2:48 PM, Sean Owen notifications@github.com wrote:
Mihir Monani
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No you simply push more commits to this branch
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok. I will push more commits and update pull request. On Tue, Apr 26, 2016 at 2:52 PM, Sean Owen notifications@github.com wrote:
Mihir Monani |
||
|
|
||
| import org.apache.spark.SecurityManager | ||
| import org.apache.spark.metrics.MetricsSystem | ||
|
|
||
|
|
@@ -49,6 +52,7 @@ private[spark] class Slf4jSink( | |
| MetricsSystem.checkMinimalPollingPeriod(pollUnit, pollPeriod) | ||
|
|
||
| val reporter: Slf4jReporter = Slf4jReporter.forRegistry(registry) | ||
| .outputTo(LoggerFactory.getLogger("org.apache.spark.metrics.sink.Slf4jSink")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, it can be
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Slf4jSink.scala :- Its not about class path or class level in package. It is just a name. Ex. EDIT :- I understood what you are trying to say. I will update it with new commit. Thanks for guidance. |
||
| .convertDurationsTo(TimeUnit.MILLISECONDS) | ||
| .convertRatesTo(TimeUnit.SECONDS) | ||
| .build() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is all this config needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't think this has been addressed. It shouldn't need a new appender, right?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For log4j.properties :-
Main reason to use new appenders is to get metrics in separate file which
will reduce complexity if someone one wants to parse metric.
It would be better to use new appender so when you disable root logger ,
you will only disable application logs, not the metrics logs. ( for more
detailed and through explanation :- http://stackoverflow.com/a/23323046 )
On Tue, Apr 26, 2016 at 4:27 PM, Sean Owen notifications@github.com wrote:
Mihir Monani
(+91)-9429473434