1 2 Previous Next 16 Replies Latest reply: May 28, 2013 7:09 PM by Victor Torrez Campos RSS

    Log4j setting when using JBoss as 7.1.1.Final

    hantsy bai Master

      I also encouterned the log4j configuration in JBoss 7.1.1.Final, no doubt I had read the related reference doc and forum posts. but i can not find the solution for my project,

       

       

       

      1. I want to use log4j and slf4j together in my project, and I want to use standalone log4j configuration for my project. so I do not want to config it in the JBoss AS.

       

      2. I excluded log4j in the jboss deplyment file in my project as described in the user gudie.

       

      2. my config file conftent is :

          #### Use two appenders, one to log to console, another to log to a file  
          log4j.rootCategory=INFO, stdout, R  
            
          #### First appender writes to console  
          log4j.appender.stdout=org.apache.log4j.ConsoleAppender  
          log4j.appender.stdout.layout=org.apache.log4j.PatternLayout  
            
          # Pattern to output the caller's file name and line number.  
          log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F%L) - %m%n  
            
          #### Second appender writes to a file  
          log4j.appender.R=org.apache.log4j.RollingFileAppender  
          log4j.appender.R.File=tickler-project.log  
            
          # Control the maximum log file size  
          log4j.appender.R.MaxFileSize=10000KB  
          # Archive log files (one backup file here)  
          log4j.appender.R.MaxBackupIndex=10  
            
          log4j.appender.R.layout=org.apache.log4j.PatternLayout  
          log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n  
          
          log4j.logger.com.company=DEBUG
          log4j.logger.org.apache.velocity=INFO
      
      

       

       

      The result is it alwasy using "INFO" level in my project.

       

      My purpose is using "DEBUG" in my classes, and otthers are using "INFO"....

       

      log4j.logger.com.company=DEBUG

       

      I used the similar configurations in serveral projects, run on tomcat or JBoss 7.0.x, it worked well.

       

      Is this is a bug or I omitted something some where?

        1 2 Previous Next