Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-11687

FuseOnEAP - Application logs of one application are logged to application logs of another application using EAP's Logging Profiles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • fuse-7.4-GA
    • Camel, CXF, Fuse EAP
    • None
    • % %
    • Hide
      • It happens only at time when application is deployed.
      • Attached are two projects( each with war included for quick test).
      • Have a FuseOnEAP setup with EAP 7.2.1 + Red Hat Fuse 7.4. You would have to apply EAP 7.2.1 patch on EAP 7.2.
      • Else you can also use EAP 7.2 + Red Hat Fuse 7.3.1. Here no need of patching EAP.
      • In standalone.xml, configure two logging-profile with subsystem "urn:jboss:domain:logging:6.0".
       <subsystem xmlns="urn:jboss:domain:logging:6.0"> 
      <logging-profiles>
      -----
      -----
                      <logging-profile name="camel-cxf-jaxws-csp">
                          <file-handler name="camel-cxf-jaxws-handler">
                              <level name="INFO"/>
                              <formatter>
                                  <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %.1p (%-10t) [%-35c] %-5X{camel.contextId} | %-30.30X{camel.routeId} | %-10X{pnr} | %m%n"/>
                              </formatter>
                              <file relative-to="jboss.server.log.dir" path="camel-cxf-jaxws.log"/>
                              <append value="true"/>
                          </file-handler>
                          <root-logger>
                              <level name="INFO"/>
                              <handlers>
                                  <handler name="camel-cxf-jaxws-handler"/>
                              </handlers>
                          </root-logger>
                      </logging-profile>
       <logging-profile name="camel-cxf-jaxrs-csp">
                          <file-handler name="camel-cxf-jaxrs-handler">
                              <level name="INFO"/>
                              <formatter>
                                  <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %.1p (%-10t) [%-35c] %-5X{camel.contextId} | %-30.30X{camel.routeId} | %-10X{pnr} | %m%n"/>
                              </formatter>
                              <file relative-to="jboss.server.log.dir" path="camel-cxf-jaxrs.log"/>
                              <append value="true"/>
                          </file-handler>
                          <root-logger>
                              <level name="INFO"/>
                              <handlers>
                                  <handler name="camel-cxf-jaxrs-handler"/>
                              </handlers>
                          </root-logger>
                      </logging-profile>
      
                  </logging-profiles>
              </subsystem>
      
      • Deploy both wars to "EAP_HOME/standalone/deployments" folder.
      • Start EAP in standalone mode with command "EAP_HOME/bin/standalone.sh".
      • Check log files camel-cxf-jaxws.log and camel-cxf-jaxrs.log at EAP_HOME/standalone/log.
      • Following logs of file camel-cxf-jaxws.log.
        2019-09-19 20:51:18,126 I (MSC service thread 1-6) [org.apache.camel.spring.SpringCamelContext] *cxfws-camel-context* |                                |            | MDC logging is enabled on CamelContext: cxfws-camel-context
        2019-09-19 20:51:18,126 I (MSC service thread 1-6) [org.apache.camel.management.ManagedManagementStrategy] *cxfws-camel-context* |                                |            | JMX is enabled
        2019-09-19 20:51:18,126 I (MSC service thread 1-5) [org.apache.camel.management.ManagedManagementStrategy] *cxfrs-camel-context* |                                |            | JMX is enabled
        2019-09-19 20:51:18,700 I (MSC service thread 1-6) [org.apache.camel.impl.converter.DefaultTypeConverter] *cxfws-camel-context* |                                |            | Type converters loaded (core: 194, classpath: 2781)
        2019-09-19 20:51:18,911 I (MSC service thread 1-6) [org.apache.camel.spring.SpringCamelContext] *cxfws-camel-context* |                                |            | StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
        2019-09-19 20:51:18,919 I (MSC service thread 1-6) [org.apache.camel.impl.HeadersMapFactoryResolver] *cxfws-camel-context* |                                |            | Detected and using custom HeadersMapFactory: org.apache.camel.component.headersmap.FastHeadersMapFactory@236ffde8
        2019-09-19 20:51:18,988 I (MSC service thread 1-5) [org.apache.camel.util.CamelContextHelper] *cxfrs-camel-context* |                                |            | No existing PropertiesComponent has been configured, creating a new default PropertiesComponent with name: properties
        
        
      • Above we focus on words cxfws-camel-context and cxfrs-camel-context than these are camel-context-id of two different apps. In this log file we shouldn't have logs of cxfrs-camel-context. Start is just to highlight.
      • Important Note 1 : If you build project camel-cxf-jaxrs than you would have to explicitly replace existing values with following entry in META-INF/MANIFEST.MF file of generated war file in target folder. In pom.xml I specified this in maven-war-plugin but it doesn't pick up, hence this workaround is required.
        Manifest-Version: 1.0
        Logging-Profile: camel-cxf-jaxrs-csp
        
      • - Important Note 2 : If you build project camel-cxf-jaxws than you would have to explicitly replace existing values with following entry in META-INF/MANIFEST.MF file of generated war file in target folder. In pom.xml I specified this in maven-war-plugin but it doesn't pick up, hence this workaround is required..
        Manifest-Version: 1.0
        Logging-Profile: camel-cxf-jaxws-csp
        
      Show
      It happens only at time when application is deployed. Attached are two projects( each with war included for quick test). Have a FuseOnEAP setup with EAP 7.2.1 + Red Hat Fuse 7.4. You would have to apply EAP 7.2.1 patch on EAP 7.2. Else you can also use EAP 7.2 + Red Hat Fuse 7.3.1. Here no need of patching EAP. In standalone.xml, configure two logging-profile with subsystem "urn:jboss:domain:logging:6.0". <subsystem xmlns= "urn:jboss:domain:logging:6.0" > <logging-profiles> ----- ----- <logging-profile name= "camel-cxf-jaxws-csp" > <file-handler name= "camel-cxf-jaxws-handler" > <level name= "INFO" /> <formatter> <pattern-formatter pattern= "%d{yyyy-MM-dd HH:mm:ss,SSS} %.1p (%-10t) [%-35c] %-5X{camel.contextId} | %-30.30X{camel.routeId} | %-10X{pnr} | %m%n" /> </formatter> <file relative-to= "jboss.server.log.dir" path= "camel-cxf-jaxws.log" /> <append value= " true " /> </file-handler> <root-logger> <level name= "INFO" /> <handlers> <handler name= "camel-cxf-jaxws-handler" /> </handlers> </root-logger> </logging-profile> <logging-profile name= "camel-cxf-jaxrs-csp" > <file-handler name= "camel-cxf-jaxrs-handler" > <level name= "INFO" /> <formatter> <pattern-formatter pattern= "%d{yyyy-MM-dd HH:mm:ss,SSS} %.1p (%-10t) [%-35c] %-5X{camel.contextId} | %-30.30X{camel.routeId} | %-10X{pnr} | %m%n" /> </formatter> <file relative-to= "jboss.server.log.dir" path= "camel-cxf-jaxrs.log" /> <append value= " true " /> </file-handler> <root-logger> <level name= "INFO" /> <handlers> <handler name= "camel-cxf-jaxrs-handler" /> </handlers> </root-logger> </logging-profile> </logging-profiles> </subsystem> Deploy both wars to "EAP_HOME/standalone/deployments" folder. Start EAP in standalone mode with command "EAP_HOME/bin/standalone.sh". Check log files camel-cxf-jaxws.log and camel-cxf-jaxrs.log at EAP_HOME/standalone/log. Following logs of file camel-cxf-jaxws.log. 2019-09-19 20:51:18,126 I (MSC service thread 1-6) [org.apache.camel.spring.SpringCamelContext] *cxfws-camel-context* | | | MDC logging is enabled on CamelContext: cxfws-camel-context 2019-09-19 20:51:18,126 I (MSC service thread 1-6) [org.apache.camel.management.ManagedManagementStrategy] *cxfws-camel-context* | | | JMX is enabled 2019-09-19 20:51:18,126 I (MSC service thread 1-5) [org.apache.camel.management.ManagedManagementStrategy] *cxfrs-camel-context* | | | JMX is enabled 2019-09-19 20:51:18,700 I (MSC service thread 1-6) [org.apache.camel.impl.converter.DefaultTypeConverter] *cxfws-camel-context* | | | Type converters loaded (core: 194, classpath: 2781) 2019-09-19 20:51:18,911 I (MSC service thread 1-6) [org.apache.camel.spring.SpringCamelContext] *cxfws-camel-context* | | | StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http: //camel.apache.org/stream-caching.html 2019-09-19 20:51:18,919 I (MSC service thread 1-6) [org.apache.camel.impl.HeadersMapFactoryResolver] *cxfws-camel-context* | | | Detected and using custom HeadersMapFactory: org.apache.camel.component.headersmap.FastHeadersMapFactory@236ffde8 2019-09-19 20:51:18,988 I (MSC service thread 1-5) [org.apache.camel.util.CamelContextHelper] *cxfrs-camel-context* | | | No existing PropertiesComponent has been configured, creating a new default PropertiesComponent with name: properties Above we focus on words cxfws-camel-context and cxfrs-camel-context than these are camel-context-id of two different apps. In this log file we shouldn't have logs of cxfrs-camel-context . Start is just to highlight. Important Note 1 : If you build project camel-cxf-jaxrs than you would have to explicitly replace existing values with following entry in META-INF/MANIFEST.MF file of generated war file in target folder. In pom.xml I specified this in maven-war-plugin but it doesn't pick up, hence this workaround is required. Manifest-Version: 1.0 Logging-Profile: camel-cxf-jaxrs-csp - Important Note 2 : If you build project camel-cxf-jaxws than you would have to explicitly replace existing values with following entry in META-INF/MANIFEST.MF file of generated war file in target folder. In pom.xml I specified this in maven-war-plugin but it doesn't pick up, hence this workaround is required.. Manifest-Version: 1.0 Logging-Profile: camel-cxf-jaxws-csp
    • Fuse 7.6 - Sprint 55 (1/4)

            rnetuka@redhat.com Radovan Netuka
            rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: