How to log Apache CXF Soap Request and Soap Response using Log4j?

前端 未结 10 1061
谎友^
谎友^ 2020-11-29 19:07

I am using the Apache CXF Framework. Inside my client program, I need to log CXF SOAP Requests and SOAP Responses. When I used



        
10条回答
  •  余生分开走
    2020-11-29 19:47

    You need to create a file named org.apache.cxf.Logger (that is: org.apache.cxf file with Logger extension) under /META-INF/cxf/ with the following contents:

    org.apache.cxf.common.logging.Log4jLogger
    

    Reference: Using Log4j Instead of java.util.logging.

    Also if you replace standard:

    
      
        
      
    
    

    with much more verbose:

    
        
    
    
    
    
    
        
            
        
        
            
        
        
            
        
        
            
        
    
    

    Apache CXF will pretty print XML messages formatting them with proper indentation and line breaks. Very useful. More about it here.

提交回复
热议问题