4 Replies Latest reply on Jan 9, 2014 11:19 PM by Vineela Gampa

    How to make jboss log to the log files as specified in log4j.xml rather than server.log

    Vineela Gampa Novice

      Hi

       

      Iam using  jboss-eap-6.1.0. I have my log4j.xml \standalone\deployments\WebsiteServicesGateway.war\WEB-INF\log4j.properties. But all the logs are going to jboss server.log rather than to the log files specified in log4j.properties. Below is one such appender.

       

      log4j.appender.fileAndConsole=com.framework.logging.log4j.v1216.AsynchronousRollingFileAppender

      #By default this will cause console logging to be set to Level.INFO

      #To change console logging level, specify Java system property -Dapp.log.console.threshold=TRACE

      #(or other preferred level) in the Tomcat startup script or in Eclipse server's Launch Configuration

      log4j.appender.fileAndConsole.DefaultConsoleThreshold=INFO

      log4j.appender.fileAndConsole.ConsoleThreshold=${app.log.console.threshold}

      log4j.appender.fileAndConsole.threshold=${app.log.console.threshold}

      log4j.appender.fileAndConsole.BufferSize=1024

      log4j.appender.fileAndConsole.Blocking=true

      log4j.appender.fileAndConsole.File=${app.log.root}/wssg.log

       

      Iam passing -Dorg.jboss.as.logging.per-deployment=false and have my jboss-deployment-structure.xml contents as below :

       

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

      <jboss-deployment-structure>

        <deployment>

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

              <exclusions>

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

              </exclusions>

        </deployment>

      </jboss-deployment-structure>