Skip to content

Instantly share code, notes, and snippets.

@patoi
Created September 30, 2014 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patoi/b26f35430e54ee3566f7 to your computer and use it in GitHub Desktop.
Save patoi/b26f35430e54ee3566f7 to your computer and use it in GitHub Desktop.
JBOSS EAP 6.2 logging with Spring Boot and jax-ws

Spring Boot and JBOSS EAP 6.2.0 logging

Problem: There is no logging with Java jax-ws client. Other logs are written fine to server.log

logback.xml

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

    <include resource="org/springframework/boot/logging/logback/base.xml"/>
    <logger name="org.springframework.web" level="INFO"/>
    <!-- Spring WS SOAP envelop logger interceptor beállítás -->
    <logger name="org.springframework.ws.server.MessageTracing" level="TRACE" />
    <logger name="org.springframework.transaction.interceptor.TransactionInterceptor" level="TRACE" />
    <logger name="this.is.my.package" level="DEBUG"/>

</configuration>

Application.java (boot your app)

@Configuration
@ComponentScan(basePackages = "this.is.my.package")
@EnableAutoConfiguration
@EnableTransactionManagement(order = Ordered.HIGHEST_PRECEDENCE - 20)
@EnableAspectJAutoProxy
@SuppressWarnings("unchecked")
public class TomcatStart {

    /**
     * Boot app
     * @param args
     */
    public static void main(String[] args) {
        
        // JAX-WS logs: http://stackoverflow.com/questions/1945618/tracing-xml-request-responses-with-jax-ws
        System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
        System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
        System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
        System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");
        
        SpringApplication springApp = new SpringApplication(TomcatStart.class);
        springApp.addListeners(new ApplicationPidListener("application.pid"));
        springApp.run(args);
    }

standalone.xml configuration modification

    <system-properties>
        <property name="org.apache.cxf.logging.enabled" value="true"/>
    </system-properties>

...

            <logger category="hu.vanio">
                <level name="DEBUG"/>
            </logger> 
            <logger category="org.springframework.transaction.interceptor.TransactionInterceptor">
                <level name="TRACE"/>
            </logger>   
            <logger category="org.springframework.ws.server.MessageTracing">
                <level name="TRACE"/>
            </logger>
            <logger category="org.springframework.web">
                <level name="INFO"/>
            </logger>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment