-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-8118] [SQL] Redirects Parquet JUL logger via SLF4J #8196
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
[SPARK-8118] [SQL] Redirects Parquet JUL logger via SLF4J #8196
Conversation
|
cc @davies |
|
Test build #40864 has finished for PR 8196 at commit
|
|
Test build #40868 has finished for PR 8196 at commit
|
|
The last build failure was actually caused by a dependency resolution timeout. |
|
retest this please |
|
Test build #40885 has finished for PR 8196 at commit
|
|
Test build #40886 timed out for PR 8196 at commit |
|
retest this please |
|
@liancheng I tried it locally, the logging from parquet still came out (updated the log4j configs). |
|
Test build #40934 has finished for PR 8196 at commit
|
|
@davies Sorry that I used the wrong logger name, should be package name rather than the class name of the logger. |
|
Seems that now Parquet logs are successfully suppressed, but I hit the opposite problem: I can't get Parquet logs written even if I turn log level under INFO. Instead, I always see this when Parquet logs should be printed: However, slf4j-log4j12 classes are already properly packaged into the assembly jar. This is irrelevant to Hive isolated client loader, since I tested this issue without enabling |
|
@liancheng It works like a charm, thanks! LGTM. |
|
@davies Nah, it works too well... Please see my last comment :) |
|
However, I think it's OK to have this merged, since we turned off Parquet logs completely in all prior versions. |
|
Even without this patch, we still see this warning about failed to load "org.slf4j.impl.StaticLoggerBinder", I think it's a another issue, we can merge this, leave that for another PR (https://issues.apache.org/jira/browse/SPARK-10057). |
|
cc @yhuai for another look. |
|
Test build #41020 has finished for PR 8196 at commit
|
|
@yhuai Thanks, updated. |
|
Test build #41102 has finished for PR 8196 at commit
|
|
The test failure is irrelevant. I'm merging this to master and branch-1.5. |
Parquet hard coded a JUL logger which always writes to stdout. This PR redirects it via SLF4j JUL bridge handler, so that we can control Parquet logs via `log4j.properties`. This solution is inspired by https://github.com/Parquet/parquet-mr/issues/390#issuecomment-46064909. Author: Cheng Lian <[email protected]> Closes #8196 from liancheng/spark-8118/redirect-parquet-jul. (cherry picked from commit 5723d26) Signed-off-by: Cheng Lian <[email protected]>
…erations ## What changes were proposed in this pull request? [SPARK-8118](#8196) implements redirecting Parquet JUL logger via SLF4J, but it is currently applied only when READ operations occurs. If users use only WRITE operations, there occurs many Parquet logs. This PR makes the redirection work on WRITE operations, too. **Before** ```scala scala> spark.range(10).write.format("parquet").mode("overwrite").save("/tmp/p") SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Jun 26, 2016 9:04:38 PM INFO: org.apache.parquet.hadoop.codec.CodecConfig: Compression: SNAPPY ............ about 70 lines Parquet Log ............. scala> spark.range(10).write.format("parquet").mode("overwrite").save("/tmp/p") ............ about 70 lines Parquet Log ............. ``` **After** ```scala scala> spark.range(10).write.format("parquet").mode("overwrite").save("/tmp/p") SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. scala> spark.range(10).write.format("parquet").mode("overwrite").save("/tmp/p") ``` This PR also fixes some typos. ## How was this patch tested? Manual. Author: Dongjoon Hyun <[email protected]> Closes #13918 from dongjoon-hyun/SPARK-16221.
Parquet hard coded a JUL logger which always writes to stdout. This PR redirects it via SLF4j JUL bridge handler, so that we can control Parquet logs via
log4j.properties.This solution is inspired by https://github.com/Parquet/parquet-mr/issues/390#issuecomment-46064909.