Use my log4j under jboss 6

后端 未结 3 784
独厮守ぢ
独厮守ぢ 2020-12-30 13:23

I want to deploy my web application on JBOSS6. The applicaation itself works, but the logging doens\'t. I use log4j and have added a jboss-deployment-structure.xml to my war

3条回答
  •  别那么骄傲
    2020-12-30 14:06

    to set my log4j in the classpath correctly i did 2 things :

    1) I set the name of the log4j to use like this

    -Dlog4j.configuration=fox-log4j.xml
    

    this one has to be in the CLASSPATH

    2) I call the logging manager explicitly otherwise the jboss log4j wont work

    this gives in my run.conf :

    #parameter used by the JVM and call later in the log4j.xml
    LOG_FOLDER=$DIRNAME/../server/default/log
    #jvm options
    JAVA_OPTS="-Xms256m -Xmx4096m -XX:MaxPermSize=1024m -Dlog4j.configuration=fox-log4j.xml \
    -Dfile.encoding=UTF-8 -Dfile.io.encoding=UTF-8 -DjavaEncoding=UTF-8 -Djboss.platform.mbeanserver \
    -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl \
    -Djava.util.logging.manager=org.jboss.logmanager.LogManager \
    -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl \
    -DLOG_FOLDER=$LOG_FOLDER"
    

    now a piece of my log4j :

    
    
    
    
     
      
      
      
      
      
      
       
      
     
    
     
        
        
     
    
      
        
        
     
    
    

    hope this could help. regards

提交回复
热议问题