Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to list out all the queries executed by a page and log the all queries executed by a page. I am using MYSQL. Can any one help me with this?
Posted
Updated 15-Apr-11 1:28am
v3

The answer to your problem is Log4Net which you will find here: http://logging.apache.org/log4net/[^].
It's a logging framework derived from a Java project Log4J and has all the stuff you need to do good logging. It can be customized if you want to, but for starters you'll probably be quite happy with it the way it is.

Cheers,

-MRB
 
Share this answer
 
Comments
Espen Harlinn 15-Apr-11 8:19am    
Good advice, my 5
I think for you it is better to write your own logic.
because it may contain select,update,sp,etc..
So Maintain one variable globally and write your own logic
 
Share this answer
 
Queries by a page or queries by a session. Queries by page can be known at design time. I think you are asking about queries by session for the particular page. Even not page global variable which destroyed once the page html rendered, you need a session variable counter Session[Page1_Queries] and increment whenever you succeed with a query.
 
Share this answer
 
Comments
Espen Harlinn 15-Apr-11 8:19am    
Another nice and simple solution, 5ed!
Albin Abel 15-Apr-11 9:07am    
Thanks Espen Harlinn
You can take a use of SQL Profiler
SQLProfiler : tool which gives all Queries fired during your Page life cycle

for more info click Here[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900