3 Replies Latest reply on Feb 18, 2014 10:05 AM by Max Barkley

    Can't See Log Output Running Errai From EAP 6.1

    Charles Odili Apprentice

      I guess this has to do with JBoss EAP, but I can' see server-side log output for my errai tutorial app. How can I fix this.

      // in server package
      public class Resources {
         @SuppressWarnings("unused")
         @Produces
         @PersistenceContext
         private EntityManager em;
      
         @Produces
         public Logger produceLog(InjectionPoint injectionPoint) {
            return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
         }
      }
      
      
      // in server package
      @Dependent
      public abstract class CRUD<M> {
      
        @Inject
        protected Logger log;
      
      
        @Inject
        protected EntityManager em;
        ...
        
        protected M fetchEntity(Long id){
             log.severe("......");
             ...
             log.severe("......");
             ...
        }
      
      }
      
      
      // in server package
      @Dependent
      public abstract class BaseEndpoint<M, D extends DeleteEvent> extends CRUD<M> implements RESTService<M> {
      
        ...
      
        public BaseEndpoint() {
             super();
        }
      
      
        @Override
        public M fetch(Long id) {
             log.severe("...");
             return fetchEntity(id);
        }
      }
      
      
      // in server package
      @RequestScoped
      public class SuppliersEndpointImpl extends BaseEndpoint<Supplier, SupplierDeleted> implements SuppliersEndpoint {
      
        public SuppliersEndpointImpl() {
             super();
        }
        ...
      
      }
      
      
      

       

      I do not see these server-side log output on the console. There's this talk about EAP using per-deployment logging, but the errai project already has a log4j.properties file and I think the new EAP system is supposed to work with that but it doesn't. What else can I tweak.

        • 1. Re: Can't See Log Output Running Errai From EAP 6.1
          Charles Odili Apprentice

          I followed steps from here http://blog.jyore.com/?p=234 to use traditional approach by adding a boss-deployment-structure.xml file in WEB-INF folder containing :

          <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

              <deployment>

                  <exclusions>

                      <module name="org.apache.log4j"/>

                      <module name="org.apache.commons.logging"/>

                  </exclusions>

              </deployment>

          </jboss-deployment-structure>

           

          But no success.

          • 2. Re: Can't See Log Output Running Errai From EAP 6.1
            Charles Odili Apprentice

            Since Errai now allows using of local AS instance for development, how can one pass startup parameters to the AS instance. I need to set -Dorg.jboss.as.logging.per-deployment=false and added it to <extraJvmArgs> thus:

             

            <plugins>

                  <plugin>

                    <groupId>org.codehaus.mojo</groupId>

                    <artifactId>gwt-maven-plugin</artifactId>

                    <version>${gwt.version}</version>

                    <executions>

                      <execution>

                        <goals>

                          <goal>resources</goal>

                          <goal>compile</goal>

                        </goals>

                      </execution>

                    </executions>

                    <configuration>

                      <extraJvmArgs>...  -Dorg.jboss.as.logging.per-deployment=false ...</extraJvmArgs>

                      <logLevel>DEBUG</logLevel>

                      <strict>true</strict>

                      <noServer>false</noServer>

                      <server>org.jboss.errai.cdi.server.gwt.JBossLauncher</server>

                      <disableCastChecking>true</disableCastChecking>

                      <runTarget>${errai.dev.context}/index.html</runTarget>

                      <soyc>false</soyc>

                      <hostedWebapp>src/main/webapp</hostedWebapp>

                    </configuration>

                  </plugin>

                 .....

            </plugins>

             

            Is this how to go about it.

            • 3. Re: Re: Can't See Log Output Running Errai From EAP 6.1
              Max Barkley Expert

              There's a special JVM argument you can use in the <extraJvmArgs> tag as of M4, that is used to set JAVAOPTS for the JVM running the Application Server. The flag is:

              -Derrai.jboss.javaopts=${JAVAOPTS}
              

               

              Here is the documentation for the JBossLauncher configurations.