views:

169

answers:

1

I'm creating a Spring-WS based webservice and running it in tomcat. I made some change and now get a fault with OperationUnsupportedException.

I'd like to see the entire stack trace that Spring-WS is getting, but cannot figure out how to have it logged.

Does anybody know how to have this stack trace logged somewhere?

A: 

If you add a log4j.properties file to the root of your source folder with the following settings:

log4j.rootLogger=WARN, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p [%c] - <%m>%n

log4j.logger.package.name.that.you.are.interested.in=DEBUG
log4j.logger.org.springframework=ERROR

Then the stacktrace should be printed in the terminal window you started the application from.

Updated

That's good you found a solution with log4j.

But if you're relatively new to log4j, I will recommend you to take a look at SLF4J framework. I have written about how to route log messages from Apache Commons Logging and log4J to SLF4J here. (Tomcat and Spring logs with Apache Commons Logging)

Espen
Thanks. I had to enable log4j, but this got me started and I found more docs at: http://tomcat.apache.org/tomcat-6.0-doc/logging.html
Dave
I'll take a look at SLF4J
Dave