I have a text file parsing system which extracts data from content files and inserts that data into a MYSQL database. I wrote some of it, and some of it was already written when I started. There is a very high number of files from which this information comes from.

As of late the data in the database has been a little off. I want to somehow keep track of which parsing scripts are updating which database.tables during the parsing process. This process happens automatically of off a live data feed from the company which provides our content files.

What I'm asking is: Is there a way by which I can write a script which can monitor the database and when an INSERT/UPDATE/REPLACE query is run, this script finds the source of the query and logs it into a text file? I'd rather do this than add print statements and OUTPUT filehandles to every single one of the parsing scripts.

Thanks in advance for any suggestions. Please let me know if I'm not being clear on this.

Amel - f.k.a. - kel


In reply to Database/Process Logging by dsb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.