2 Replies Latest reply on Dec 8, 2003 2:16 PM by sanepid

    separate log4j.xml deployed in an ear

    sanepid

      Hello,
      I have an application deployed as an ear archive and I want to enable log4j within it. One sollution would be to add all appenders/loggers to the conf/log4j.xml descriptor, but I would like to have all bits and pieces of my application contained by the ear. In essence, the question is how could I separate the JBoss log4j from my application log4j.

      I use JBoss 3.2.2 RC4

      Any suggestion highly appreciated
      Thanks
      Radu

        • 1. Re: separate log4j.xml deployed in an ear
          lyc1

          Try to embed in your EAR a logger service (.sar), with jboss-service.xml which describes your logger service and log4j.xml file wich describes your appenders

          Don't forget to declare this service in the application.xml or jboss-app.xml file of the EAR.

          • 2. Re: separate log4j.xml deployed in an ear
            sanepid

            Thanks for suggestion
            Deploying a logging SAR was my first thought also, but I couldn't figure out how to load my log4j.xml in my ear without overriding the Log4jService class to use the Thread.currentThread().getContextClassLoader().getResourceAsStream(propertyFileName) rather then looking in the conf directory for log4j.xml

            Any suggestions on this one
            Thanks
            Radu