This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch 5.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.2 by this push:
     new 6343ca3809 PHOENIX-7477 Set java.util.logging.config.class in scripts 
(#2040)
6343ca3809 is described below

commit 6343ca3809ed27271934184aa5f16976d67086eb
Author: Istvan Toth <[email protected]>
AuthorDate: Tue Jan 14 16:52:43 2025 +0100

    PHOENIX-7477 Set java.util.logging.config.class in scripts (#2040)
    
    and add org.slf4:jul-to-slf4j to classpath where needed
---
 bin/performance.py                                                | 4 +++-
 bin/pherf-standalone.py                                           | 3 ++-
 bin/phoenix_utils.py                                              | 2 ++
 bin/psql.py                                                       | 4 +++-
 bin/sqlline.py                                                    | 3 ++-
 phoenix-assembly/src/build/components/all-common-dependencies.xml | 1 +
 phoenix-core-client/pom.xml                                       | 4 ++++
 phoenix-core/pom.xml                                              | 8 ++++++++
 phoenix-pherf/pom.xml                                             | 8 ++++++++
 pom.xml                                                           | 5 +++++
 10 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/bin/performance.py b/bin/performance.py
index 5b09a29c93..11d8b483ee 100755
--- a/bin/performance.py
+++ b/bin/performance.py
@@ -65,7 +65,9 @@ phoenix_utils.setPath()
 
 java_cmd = phoenix_utils.java
 
-execute = ('%s %s $PHOENIX_OPTS -cp 
"%s%s%s%s%s"-Dlog4j2.configurationFile=file:' +
+execute = ('%s %s $PHOENIX_OPTS -cp "%s%s%s%s%s"' +
+           ' 
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
 ' +
+           ' -Dlog4j2.configurationFile=file:' +
            os.path.join(phoenix_utils.current_dir, "log4j2.properties") +
            ' org.apache.phoenix.util.PhoenixRuntime -t %s %s ') % \
     (java_cmd, phoenix_utils.jvm_module_flags, hbase_config_path, os.pathsep,
diff --git a/bin/pherf-standalone.py b/bin/pherf-standalone.py
index 14f5500fb1..e53ecf9d34 100755
--- a/bin/pherf-standalone.py
+++ b/bin/pherf-standalone.py
@@ -38,7 +38,8 @@ java_cmd = phoenix_utils.java + ' ' + 
phoenix_utils.jvm_module_flags + \
     phoenix_utils.logging_jar + os.pathsep + \
     phoenix_utils.phoenix_client_embedded_jar + os.pathsep +\
     phoenix_utils.phoenix_pherf_jar + \
-    '" -Dlog4j2.configurationFile=file:' + \
+    '" 
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
 ' +\
+    ' -Dlog4j2.configurationFile=file:' + \
     os.path.join(phoenix_utils.current_dir, "log4j2.properties") + \
     " org.apache.phoenix.pherf.Pherf " + args 
 
diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py
index 6f8469b74b..ee26bbe933 100755
--- a/bin/phoenix_utils.py
+++ b/bin/phoenix_utils.py
@@ -86,6 +86,7 @@ def setPath():
     LOGGING_JAR_PATTERN = "log4j-core*.jar"
     LOGGING_JAR_PATTERN2 = "log4j-api*.jar"
     LOGGING_JAR_PATTERN3 = "log4j-1.2-api*.jar"
+    LOGGING_JAR_PATTERN4 = "jul-to-slf4j*.jar"
     SQLLINE_WITH_DEPS_PATTERN = "sqlline-*-jar-with-dependencies.jar"
 
 
@@ -189,6 +190,7 @@ def setPath():
         logging_jar = findFileInPathWithoutRecursion(LOGGING_JAR_PATTERN, 
os.path.join(current_dir, "..","lib"))
         logging_jar += 
":"+findFileInPathWithoutRecursion(LOGGING_JAR_PATTERN2, 
os.path.join(current_dir, "..","lib"))
         logging_jar += 
":"+findFileInPathWithoutRecursion(LOGGING_JAR_PATTERN3, 
os.path.join(current_dir, "..","lib"))
+        logging_jar += 
":"+findFileInPathWithoutRecursion(LOGGING_JAR_PATTERN4, 
os.path.join(current_dir, "..","lib"))
 
     __set_java_home()
     __set_jvm_flags()
diff --git a/bin/psql.py b/bin/psql.py
index 03d76bc830..decf8c2258 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -34,7 +34,9 @@ java_cmd = phoenix_utils.java + ' ' + 
phoenix_utils.jvm_module_flags + ' $PHOENI
     ' -cp "' + phoenix_utils.hbase_conf_dir + os.pathsep + 
phoenix_utils.hadoop_conf + \
     os.pathsep + phoenix_utils.slf4j_backend_jar + \
     os.pathsep + phoenix_utils.logging_jar + \
-    os.pathsep + phoenix_utils.phoenix_client_embedded_jar + '" 
-Dlog4j2.configurationFile=file:' + \
+    os.pathsep + phoenix_utils.phoenix_client_embedded_jar + \
+    '" 
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
 ' + \
+    ' -Dlog4j2.configurationFile=file:' + \
     os.path.join(phoenix_utils.current_dir, "log4j2.properties") + \
     " org.apache.phoenix.util.PhoenixRuntime " + args 
 
diff --git a/bin/sqlline.py b/bin/sqlline.py
index 0a15265dfc..4f9479b564 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -97,7 +97,8 @@ java_cmd = phoenix_utils.java + ' ' + 
phoenix_utils.jvm_module_flags + ' $PHOENI
     phoenix_utils.slf4j_backend_jar + os.pathsep + \
     phoenix_utils.logging_jar + os.pathsep + \
     phoenix_utils.phoenix_client_embedded_jar + \
-    '" -Dlog4j2.configurationFile=file:' + 
os.path.join(phoenix_utils.current_dir, "log4j2.properties") + \
+    '" 
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
 ' + \
+    ' -Dlog4j2.configurationFile=file:' + 
os.path.join(phoenix_utils.current_dir, "log4j2.properties") + \
     disable_jna + \
     " sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver" + \
     (not args.noconnect and " -u " + phoenix_utils.shell_quote([jdbc_url]) or 
"") + \
diff --git a/phoenix-assembly/src/build/components/all-common-dependencies.xml 
b/phoenix-assembly/src/build/components/all-common-dependencies.xml
index 4a5fd9bf86..68290829e7 100644
--- a/phoenix-assembly/src/build/components/all-common-dependencies.xml
+++ b/phoenix-assembly/src/build/components/all-common-dependencies.xml
@@ -24,6 +24,7 @@
       <outputDirectory>/lib</outputDirectory>
       <includes>
         <include>sqlline:sqlline:jar:jar-with-dependencies</include>
+        <include>org.slf4j:jul-to-slf4j</include>
         <include>org.apache.logging.log4j:log4j-slf4j-impl</include>
         <include>org.apache.logging.log4j:log4j-api</include>
         <include>org.apache.logging.log4j:log4j-core</include>
diff --git a/phoenix-core-client/pom.xml b/phoenix-core-client/pom.xml
index ff88b0db6d..82aabddfa3 100644
--- a/phoenix-core-client/pom.xml
+++ b/phoenix-core-client/pom.xml
@@ -151,6 +151,10 @@
             </goals>
             <configuration>
               <artifactItems>
+                <artifactItem>
+                  <groupId>org.slf4j</groupId>
+                  <artifactId>jul-to-slf4j</artifactId>
+                </artifactItem>
                 <artifactItem>
                   <groupId>org.apache.logging.log4j</groupId>
                   <artifactId>log4j-api</artifactId>
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index f726d9fba2..e754dbe621 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -105,6 +105,9 @@
                         <ignoredUnusedDeclaredDependency>
                             org.apache.logging.log4j:log4j-1.2-api
                         </ignoredUnusedDeclaredDependency>
+                        <ignoredUnusedDeclaredDependency>
+                            org.slf4j:jul-to-slf4j
+                        </ignoredUnusedDeclaredDependency>
                     </ignoredUnusedDeclaredDependencies>
                     <ignoredUsedUndeclaredDependencies>
                     </ignoredUsedUndeclaredDependencies>
@@ -448,6 +451,11 @@
         </dependency>
 
         <!-- logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jul-to-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-api</artifactId>
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index bebca65b98..f3c0e08776 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -161,6 +161,11 @@
     </dependency>
 
     <!-- Test Dependencies -->
+    <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>jul-to-slf4j</artifactId>
+        <scope>test</scope>
+    </dependency>
     <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-api</artifactId>
@@ -311,6 +316,9 @@
             <ignoredUnusedDeclaredDependency>
               org.apache.logging.log4j:log4j-1.2-api
             </ignoredUnusedDeclaredDependency>
+            <ignoredUnusedDeclaredDependency>
+              org.slf4j:jul-to-slf4j
+            </ignoredUnusedDeclaredDependency>
           </ignoredUnusedDeclaredDependencies>
           <ignoredUsedUndeclaredDependencies>
             <ignoredUsedUndeclaredDependency>
diff --git a/pom.xml b/pom.xml
index 492b794b6f..0c8a228ea5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1780,6 +1780,11 @@
         <artifactId>slf4j-reload4j</artifactId>
         <version>${slf4j.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId> jul-to-slf4j </artifactId>
+        <version>${slf4j.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-api</artifactId>

Reply via email to