Reputation: 483
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 SQL
log statements to be printed to my Tomcat
console?
Context:
Tomcat
8MySql
Hibernate
to query the databaseUpvotes: 1
Views: 644
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
Upvotes: 0
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