0 Replies Latest reply on Dec 3, 2005 1:02 AM by Yuhong Qian

    how to use my own log4j.properties

    Yuhong Qian Newbie


      I have a J2EE project which includes EJB and Servlets, I deploy it by copying bookmark.ear to the C:\jboss-4.0.1\server\default\deploy folder.

      I'd like to separate my appliaction logs by using my own log4j.properties.
      My own log4j.properties is packaged in the bookmark.war.

      In order to do that, I rename the C:\jboss-4.0.1\server\default\conf\log4j.xml to jboss-log4j.xml and update the conf\jboss-service.xml as follows:

      Change resource:log4j.xml to resource:jboss-log4j.xml

      Then I change jboss-web.xml for class-loading, as shown below:


      <class-loading java2ClassLoadingCompliance="false">


      My log4j.properties is as follows:

      #define servletlog
      log4j.appender.file3.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n

      In my servlet, I call the logger with the syntax:

      private Logger logger = Logger.getLogger(servletlog);

      logger.debug("###A debug message from bookmark app###");

      The expected result would be at the C:\jboss-4.0.1\server\default\log folder a servlet.log created.

      But unfortunately nothing happen. Neither no servlet.log under the
      C:\jboss-4.0.1\server\default\log folder nor other places.

      What's wrong? Any help are highly appreciated.