Greetings Perl Monks!
I have a web application with at least 100 SQL queries (never counted them), scattered through various modules for various purposes. I connect to a MySQL database via DBI module.
I would like to log every query execution into a file, ie. to write in the file something like:
execution_timestamp, full_query
The problem is that every query is prepared and executed wheen needed in the program, so I should go through all the sources and add a function to write the log for each succesfull query execution, which is bad (tm).
So, is there a way of enabling that kind of logging in DBI (or MySQL itself) on a global execution level?
Thnx for answers!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.