0 Replies Latest reply on Aug 17, 2010 4:15 PM by Brad Collins

    JBoss 5.0.1: log4j.properties file not taking effect in EAR

    Brad Collins Newbie

      Hello, all.

       

      I cannot get the settings in my log4j.properties file to take effect. I've already followed the advice in the following forum discussion:

       

      http://community.jboss.org/message/198690#198690

       

      Here is my log4j.properties file (in the root directory of the EAR):

       

       

      #
      # The root logger is set to INFO by default.
      # This level can be changed programmatically at runtime.
      #
      log4j.rootLogger=INFO, stdout, file
      # use the hibernate appender for audit logs.
      log4j.logger.auditLogger.com.anfscd=INFO, hibernate, HBSS
      # Console appender.
      log4j.appender.stdout=org.apache.log4j.ConsoleAppender
      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
      log4j.appender.stdout.layout.ConversionPattern=%-5p %d %c %x - %m %n
      log4j.appender.stdout.Threshold=WARN
      # Use this ConversionPattern to display thread.
      #log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
      # Daily rolling file appender.
      log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
      log4j.appender.file.layout=org.apache.log4j.PatternLayout
      log4j.appender.file.File=c:/anfscd/log/anfscd-server.log
      log4j.appender.file.DatePattern='.'yyyy-MM-dd
      log4j.appender.file.layout.ConversionPattern=%-5p %d %c %x - %m %n
      # Use this ConversionPattern to display thread.
      #log4j.appender.file.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
      # Hibernate appender
      log4j.appender.hibernate=com.anfscd.common.util.database.log.HibernateAppender
      log4j.appender.hibernate.sessionServiceClass=com.anfscd.cmd.model.util.persistence.HibernateHelper
      log4j.appender.hibernate.loggingEventClass=com.anfscd.cmd.model.audit.AuditLogRecord
      # direct log messages to windows system logs #
      log4j.appender.HBSS=org.apache.log4j.nt.NTEventLogAppender
      log4j.appender.HBSS.Source=Project Name
      log4j.appender.HBSS.layout=org.apache.log4j.PatternLayout
      log4j.appender.HBSS.layout.ConversionPattern=%-5p %d %c %x - %m %n
      # suppress org.hibernate messages
      log4j.logger.org.hibernate=ERROR, stdout

       

       

       

       

      Here is my jboss-app.xml (in [ear]/META-INF):

       

       

       

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

      <jboss-app>

      <module-order>strict</module-order>

      <loader-repository>

      com.anfscd:loader=AnfscdLoader

      <loader-repository-config>

      java2ParentDelegation=false

      </loader-repository-config>

      </loader-repository>

      </jboss-app>

       

       

      We're using Hibernate for persistence, and it is quite verbose in the output console. I don't want to see Hibernate console output unless there's an error.

       

       

      And by the way, I'm using log4j-1.2.15.jar.