4 Replies Latest reply on Oct 9, 2013 5:13 AM by Naga Karri

    log4j not working for the framework packages.

    Naga Karri Newbie

      I am using jboss-eap-6.1 with following apis/frameworks.




      cxf 2.6.6

      spring 3.0.6.RELEASE



      I have developed a RESTful service using apache cxf and my application log4j.xml is inside the war file under WEB-INF/classes. My war contains all the dependency jars (cxf, spring etc) inside WEB-INF/lib. I am deploying the war file into jboss-eap-6.1\standalone\deployments.

      The problem I am facing is with logging of frameworks specific packages. Framework logging (cxf, spring etc) not working (does not log anything in log file) if I specify the root package for example org.apache.cxf, org.springframework. But it only workswhen I specify full package name with class name, like org.apache.cxf.interceptor.LoggingInInterceptor. However the logging works for my application specific root packages for example com.mycompany.service.inventory.


      But I want to be able to log framework specific logging by specifying the root packages. Any help is much appreciated.

      Below is my log4j.xml


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

      <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">

      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

      <appender name="AppLogAppender" class="org.apache.log4j.DailyRollingFileAppender">

        <param name="file"

         value="${jboss.server.log.dir}/inventory-service.log" />

        <param name="DatePattern" value="'.'yyyy-MM-dd" />  

        <param name="Append" value="true" />

        <layout class="org.apache.log4j.PatternLayout">

         <param name="ConversionPattern" value="%-5p %d [%t] %c: %m%n" />



      <category name="org.apache.cxf">

        <priority value="INFO" />

        <appender-ref ref="AppLogAppender" />


      <category name="org.springframework">

        <priority value="INFO" />

        <appender-ref ref="AppLogAppender" />


      <category name="com.mycompany.service.inventory">

        <priority value="INFO" />

        <appender-ref ref="AppLogAppender" />



        <priority value="INFO" />

        <appender-ref ref="AppLogAppender" />