wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Logging SQL statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Logging SQL statements " Watch "Logging SQL statements " New topic
Author

Logging SQL statements

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Hi,
I can see all logged(DEBUG, ERROR, INFO, etc) statements on log files, but I can't see the SQL statments, parameters, and result set values.

I can see those also after I set up in IBM websphere admin console. here my question I want to see them on my log files how?
please see the log4j setup in log4j.properties file.



please some give me the idea to produce SQL statements too on my logs


Thanks,
Kumar
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Anyone please reply to this
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
In log4j logging file you will see only those logs, which are directed to it. In all probability your JDBC driver does not emit logging statement, thats why SQLs are not part of log file.


My Blog
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
thank you vinod,

but I can set the logs in IBM websphere console and I can see server's log file (trace.log). then why it's not possible in our application logs?
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
p6spy may help you, have a look at that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logging SQL statements