2 Replies Latest reply on Jan 17, 2014 1:58 PM by gamvi01

    Migrating WAR from Websphere to EAP 6.1.0 GA

    gamvi01

      Hi All

       

      I am migrating my war from websphere 7 to jboss 6 EAP. I want to use my own log4j.properties located at WebsiteServicesGateway.war\WEB-INF\classes\META-INF\logging\log4j.properties.  Attached the log4j.properties for your reference.

       

      My deployment structure is at WebsiteServicesGateway.war\WEB-INF\ with contents.

       

      <?xml version="1.0" encoding="UTF-8"?>

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

        <deployment>

         <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->

              <exclusions>

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

           <module name="org.jboss.log4j.logmanager"/>

              </exclusions>

        </deployment>

      </jboss-deployment-structure>

       

      I start the server with org.jboss.as.logging.per-deployment=false all will be logged under [stdout]. Log file wssg.log is getting created but no logs to that file . all the logs are going to server.log ( MY -D properties , -Dapp.log.console.threshold=INFO -Dorg.jboss.as.logging.per-deployment=false -Dapp.log.root=C:\Temp")  I tried -Dlog4j.configuration pointing to log4j.properties.

       

      Our app is using spring with jersey , so we have the below configuration.

         -

          <context-param>

              <param-name>log4jConfigLocation</param-name>

              <param-value>classpath:META-INF/logging/log4j.properties</param-value>

          </context-param>

       

      In server.log i see app is reading the log4j.properties file , and it creats those files but nothing gets printed.

      Initializing log4j from [classpath:META-INF/logging/log4j.properties]

      12:10:09,977 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/WebsiteServicesGateway]] (ServerService Thread Pool -- 59) Initializing Spring root WebApplicationContext

        • 1. Re: Migrating WAR from Websphere to EAP 6.1.0 GA
          gamvi01

          Forum discussions are active as its been 4 days since i postedit in forums but no responses

           

          I made little progress by adding exclusions for log4j and slf4j in my jboss-deployment-structure.xml. Now most of the messages are appearing.

           

          Jboss-deployment-structure.xml contents

           

          exclusions-

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

                <module name="org.slf4j.jcl-over-slf4j" />

                <module name="org.slf4j.impl" />

                <module name="org.slf4j" />

                <module name="org.slf4j.ext"/>

           

          But the loggers from com.sun.jersey.api.client.filter.LoggingFilter are not appearing . Jersey using java.util.logging . Below is the configuration for it. Log4j and Slf4j logging works fine but jdk logging doesnt happen to the configured loggers but rather routes to jboss logging.

          Which modules i need to skip or anything that i have to add as dependency ? Any info is greatly appreicated.

           

           

          log4j.logger.com.sun.jersey.api.container.filter.LoggingFilter=INFO, RESTService

          log4j.additivity.com.sun.jersey.api.container.filter.LoggingFilter=false

          #requests to serve a log file

          log4j.logger.com.sun.jersey.api.container.filter.LoggingFilter.logFile=WARN, RESTService

          log4j.additivity.com.sun.jersey.api.container.filter.LoggingFilter.logFile=false

           

           

          log4j.appender.RESTService=com.macys.mobile.framework.logging.log4j.v1216.AsynchronousRollingFileAppender

          log4j.appender.RESTService.BufferSize=512

          log4j.appender.RESTService.Blocking=true

          log4j.appender.RESTService.File=${app.log.root}/rest.log

          # Maximum file size and no: of back up files can be configured as per the production environment requirement

          log4j.appender.RESTService.MaxFileSize=100MB

          log4j.appender.RESTService.MaxBackupIndex=10

          • 2. Re: Migrating WAR from Websphere to EAP 6.1.0 GA
            gamvi01