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

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 821ad41  Workaround java.util.logging (JUL) configuration
821ad41 is described below

commit 821ad413f320bb26fd1e8c02f59723f519b12845
Author: remm <r...@apache.org>
AuthorDate: Mon Jul 15 16:45:20 2019 +0200

    Workaround java.util.logging (JUL) configuration
    
    It seems the JUL configuration is not currently implemented in native
    images, so workaround using the instructions from the GraalVM
    documentation. Also supported is using a custom LogManager. I don't know
    how to set it besides using the system property, so there is no way to
    use JULI at the moment.
---
 java/org/apache/catalina/startup/Tomcat.java | 13 +++++++++++++
 webapps/docs/changelog.xml                   |  8 +++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/startup/Tomcat.java 
b/java/org/apache/catalina/startup/Tomcat.java
index 5431e02..21b2223 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -36,6 +36,7 @@ import java.util.Stack;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.logging.Level;
+import java.util.logging.LogManager;
 import java.util.logging.Logger;
 
 import javax.servlet.Servlet;
@@ -72,6 +73,7 @@ import org.apache.catalina.util.ContextName;
 import org.apache.catalina.util.IOTools;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.UriUtil;
+import org.apache.tomcat.util.compat.JreCompat;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.file.ConfigFileLoader;
 import org.apache.tomcat.util.file.ConfigurationSource;
@@ -1386,6 +1388,17 @@ public class Tomcat {
         return result;
     }
 
+    static {
+        // Graal native images don't load any configuration except the VM 
default
+        if (JreCompat.isGraalAvailable()) {
+            try (InputStream is = new FileInputStream(new 
File(System.getProperty("java.util.logging.config.file", 
"conf/logging.properties")))) {
+                LogManager.getLogManager().readConfiguration(is);
+            } catch (SecurityException | IOException e) {
+                // Ignore, the VM default will be used
+            }
+        }
+    }
+
     /**
      * Main executable method for use with a Maven packager.
      * @param args the command line arguments
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d1f80e7..7963b3b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -90,7 +90,13 @@
   <subsection name="Other">
     <changelog>
       <fix>
-        Improvements and workarounds for GraalVM native images. (remm)
+        JNDI support for GraalVM native images. (remm)
+      </fix>
+      <fix>
+        JSP runtime library support for GraalVM native images. (remm)
+      </fix>
+      <fix>
+        java.util.logging configuration for GraalVM native images. (remm)
       </fix>
       <update>
         Update Checkstyle to 8.22. (markt)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to