[ 
https://issues.apache.org/jira/browse/PARQUET-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15059046#comment-15059046
 ] 

Ryan Blue commented on PARQUET-369:
-----------------------------------

Using java.util.logging doesn't simplify it. I think that the right way to 
simplify things is to use SLF4J because its purpose is to provide a 
good/standard API and also allow you to swap out the actual logging framework 
for whatever you want. It's basically what we were trying to do in the Log 
class but done for us. SLF4J also has a benefit of being pretty much standard 
for Java these days, which is why our dependencies use it.

The solution we've committed for Parquet MR is to use the SLF4J API and allow 
downstream consumers to choose the right underlying framework for them by 
depending on slf4j-log4j or something similar. All that is being proposed here 
is to expose the dependency from parquet-format so that those logs aren't lost. 
The trade-off is exposing the dependency vs. losing what is logged by thrift 
for the format classes. Before, we opted to remove the dependency but now that 
all of Parquet MR uses SLF4J, I'm coming around to the idea that we might want 
to expose it from parquet-format.

> Shading SLF4J prevents SLF4J locating org.slf4j.impl.StaticLoggerBinder
> -----------------------------------------------------------------------
>
>                 Key: PARQUET-369
>                 URL: https://issues.apache.org/jira/browse/PARQUET-369
>             Project: Parquet
>          Issue Type: Bug
>          Components: parquet-format
>            Reporter: Cheng Lian
>            Assignee: Ryan Blue
>             Fix For: format-2.3.1
>
>
> Parquet-format shades SLF4J to {{parquet.org.slf4j}} (see 
> [here|https://github.com/apache/parquet-format/blob/apache-parquet-format-2.3.0/pom.xml#L162]).
>  This also accidentally shades [this 
> line|https://github.com/qos-ch/slf4j/blob/v_1.7.2/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java#L207]
> {code}
> private static String STATIC_LOGGER_BINDER_PATH = 
> "org/slf4j/impl/StaticLoggerBinder.class";
> {code}
> to
> {code}
> private static String STATIC_LOGGER_BINDER_PATH = 
> "parquet/org/slf4j/impl/StaticLoggerBinder.class";
> {code}
> and thus {{LoggerFactory}} can never find the correct {{StaticLoggerBinder}} 
> implementation even if we provide dependencies like {{slf4j-log4j12}} on the 
> classpath.
> This happens in Spark. Whenever we write a Parquet file, we see the following 
> famous message and can never get rid of it:
> {noformat}
> 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.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to