Skip to content

Commit

Permalink
[trino] Fix logging in Trino plugin
Browse files Browse the repository at this point in the history
Ranger plugin access control class is injected via classloader, its
logger needs to go through trino's logger.

More details:

facebookarchive/swift#287 (comment)

Signed-off-by: Utkarsh Saxena <[email protected]>
  • Loading branch information
utk-spartan committed Oct 18, 2023
1 parent da92e12 commit d344a4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions plugin-trino/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
<artifactId>trino-spi</artifactId>
<version>${trino.version}</version>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>log</artifactId>
<version>${trino.airlift.version}</version>
</dependency>
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-jdbc</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
import org.apache.ranger.plugin.policyengine.RangerAccessResourceImpl;
import org.apache.ranger.plugin.policyengine.RangerAccessResult;
import org.apache.ranger.plugin.service.RangerBasePlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.airlift.log.Logger;

import java.io.IOException;
import java.net.URL;
Expand All @@ -62,7 +61,7 @@

public class RangerSystemAccessControl
implements SystemAccessControl {
private static Logger LOG = LoggerFactory.getLogger(RangerSystemAccessControl.class);
private static final Logger LOG = Logger.get(RangerSystemAccessControl.class);

final public static String RANGER_CONFIG_KEYTAB = "ranger.keytab";
final public static String RANGER_CONFIG_PRINCIPAL = "ranger.principal";
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<presto.re2j.version>1.1</presto.re2j.version>

<!-- trino plugin deps -->
<trino.airlift.version>0.192</trino.airlift.version>
<trino.airlift.version>208</trino.airlift.version>
<trino.bval-jsr.version>2.0.0</trino.bval-jsr.version>
<trino.guice.version>4.2.2</trino.guice.version>
<trino.guava.version>26.0-jre</trino.guava.version>
Expand Down

0 comments on commit d344a4d

Please sign in to comment.