Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7518

Loggers logs request twice in case of Fault

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.2.2, 3.1.15
    • Component/s: logging
    • Labels:
      None
    • Environment:

      JDK 1.8.0
      Apache Tomcat 8.5
      CXF 3.2.0
      Implementation logging: org.apache.cxf.common.logging.Slf4jLogger

    • Estimated Complexity:
      Unknown

      Description

      I upgraded CFX libraries from 3.1.11 to 3.2.0.
      Since then requests raising faults are logged twice.

      CXFNonSpringExampleServlet.java
         @Override
         public void loadBus(ServletConfig servletConfig) {
            super.loadBus(servletConfig);
            BusFactory.setDefaultBus(getBus());
      
            createFactoryBean();
         }
      
         /* Creazione istanza servizio */
         private void createFactoryBean() {
            JaxWsServerFactoryBean serviceFactory = new JaxWsServerFactoryBean();
      
            /* Service details */
            serviceFactory.setAddress("/");
            serviceFactory.setWsdlLocation("...");
            serviceFactory.setServiceBean(...);
            serviceFactory.setServiceClass(...);
            serviceFactory.setServiceName(new QName("urn:...", "..."));
            serviceFactory.setEndpointName(new QName("urn:...", "..."));
      
            /* Input inteceptors */
            serviceFactory.getInInterceptors().add(new LoggingInInterceptor());
            serviceFactory.getInFaultInterceptors().add(new LoggingInInterceptor());
      
            /* Output inteceptors */
            serviceFactory.getOutInterceptors().add(new LoggingOutInterceptor());
            serviceFactory.getOutFaultInterceptors().add(new LoggingOutInterceptor());
      
            server = serviceFactory.create();
       }
      

      Requests that do not raise faults are logged only once (as well as their responses): one REQ_IN INFO -> REQ_IN and one RESP_OUT INFO -> RESP_OUT

      Requests that do raise faults are logged twice (unlike their responses, logged only once): two REQ_IN INFO -> REQ_IN and one FAULT_OUT INFO -> FAULT_OUT

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              pperliti Paolo Perliti
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: