the beest
the beest

Reputation: 483

How to print P6Spy log statements to the Tomcat console

I've integrated P6Spy into my Netbeans project, and the SQL log statements are being printed to the spy.log file in the Tomcat home directory. How do I get the SQLlog statements to be printed to my Tomcat console?

Context:

Upvotes: 1

Views: 644

Answers (2)

catra
catra

Reputation: 328

P6spy is really great for logging your SQL statements. If you want to print out the statements on the console just enable in spy.properties the next line:

appender=com.p6spy.engine.spy.appender.StdoutLogger

SQL statements on the Console

Upvotes: 0

quintonm
quintonm

Reputation: 848

It sounds like you are using the default file logger. Assuming that you are using P6Spy 2.X, you can switch to an alternate logger as described in the documentation.

You can either use the StdoutLogger logger which will write to the console (but not the file) or you can switch to the Slf4JLogger logger for even more control over the log output. I would generally recommend the Slf4JLogger since it allows for integration with your application's existing logging.

Upvotes: 0

Related Questions