Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-20401

[GSS](7.3.z) Unable query logging of H2 database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.3.5.GA, 7.3.5.CR1
    • 7.3.3.GA
    • Classloading
    • None
    • False
    • False
    • +
    • Undefined
    • Hide

      1. change the datasource setting:

      [hokuda@localhost configuration]$ diff -u standalone.xml standalone-h2query.xml 
      --- standalone.xml      2020-10-13 00:25:00.000000000 +0900
      +++ standalone-h2query.xml      2020-10-23 16:34:23.936987309 +0900
      @@ -152,7 +152,7 @@
               <subsystem xmlns="urn:jboss:domain:datasources:6.0">
                   <datasources>
                       <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
      -                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
      +                  <connection-url>jdbc:h2:${jboss.server.data.dir}/test;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                           <driver>h2</driver>
                           <security>
                               <user-name>sa</user-name>
      

      2. deploy the attached jndi_datasource.war and start wildfly

      3. access http://localhost:8080/jndi_datasource/dstest

      Show
      1. change the datasource setting: [hokuda@localhost configuration]$ diff -u standalone.xml standalone-h2query.xml --- standalone.xml 2020-10-13 00:25:00.000000000 +0900 +++ standalone-h2query.xml 2020-10-23 16:34:23.936987309 +0900 @@ -152,7 +152,7 @@ <subsystem xmlns= "urn:jboss:domain:datasources:6.0" > <datasources> <datasource jndi-name= "java:jboss/datasources/ExampleDS" pool-name= "ExampleDS" enabled= " true " use-java-context= " true " statistics-enabled= "${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled: false }}" > - <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> + <connection-url>jdbc:h2:${jboss.server.data.dir}/test;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> 2. deploy the attached jndi_datasource.war and start wildfly 3. access http://localhost:8080/jndi_datasource/dstest

      The connection-url is configured as follows with TRACE_LEVEL_FILE=4 to enable query logging:

      [hokuda@localhost configuration]$ diff -u standalone.xml standalone-h2query.xml 
      --- standalone.xml      2020-10-13 00:25:00.000000000 +0900
      +++ standalone-h2query.xml      2020-10-23 16:34:23.936987309 +0900
      @@ -152,7 +152,7 @@
               <subsystem xmlns="urn:jboss:domain:datasources:6.0">
                   <datasources>
                       <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
      -                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
      +                  <connection-url>jdbc:h2:${jboss.server.data.dir}/test;TRACE_LEVEL_FILE=4;DB_CL

      [hokuda@local{code}
      [hokuda@localhost configuration]$ diff -u standalone.xml standalone-h2query.xml
      — standalone.xml 2020-10-13 00:25:00.000000000 +0900
      +++ standalone-h2query.xml 2020-10-23 16:34:23.936987309 +0900
      @@ -152,7 +152,7 @@
      <subsystem xmlns="urn:jboss:domain:datasources:6.0">
      <datasources>
      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">

      • <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
        + <connection-url>jdbc:h2:${jboss.server.data.dir}/test;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
        <driver>h2</driver>
        <security>
        <user-name>sa</user-name>
        host configuration]$ diff -u standalone.xml standalone-h2query.xml 
         — standalone.xml 2020-10-13 00:25:00.000000000 +0900
         +++ standalone-h2query.xml 2020-10-23 16:34:23.936987309 +0900
         @@ -152,7 +152,7 @@
         <subsystem xmlns="urn:jboss:domain:datasources:6.0">
         <datasources>
         <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
         - <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
         + <connection-url>jdbc:h2:${jboss.server.data.dir}/test;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
         <driver>h2</driver>
         <security>
         <user-name>sa</user-name>
        {code:java}
        OSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                             <driver>h2</driver>
                             <security>
                                 <user-name>sa</user-name>
        

        But, no query log is written in server.log.

              thofman Tomas Hofman
              rhn-support-hokuda Hisanobu Okuda
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: