WebSphere web service runtime uses WebSphere trace logging internally. You likely won't be able to direct the built-in web service traces to log4j by simply adding and configuring log4j to your web service consuming application.
However, you can use a JAX-WS standard handler to log requests and responses or faults to a log4j Logger fairly easily (but you'll have to write some code).
Here a GlassFish tutorial on JAX-WS handlers. Note that the demonstration handler logs SOAP messages to System.out
; you'll want to use log4j.
This StackOverflow post contains a full-java-class example of a SOAP message logging handler and how to register the handler programmatically so that it is executed during message processing. It too uses System.out
; you'd need to substitute something like log.debug(...)
for out.println(...)
to use log4j. You could then configure log4j with a file appender for this logger as you attempted above.
As a sidebar, if you are obtaining your service reference via @WebServiceRef
you can declaratively define a handler via XML file referenced by @HandlerChain
. An end-to-end IBM tutorial is here.