List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:July 24 2008 5:48am
Subject:Re: Log
View as plain text  
In the last episode (Jul 23), Pedro said:
> I need to pass the user of my application pro bank. I want to log the
> user's application and value of new fields or fields updated. To then
> have audit of who did what.
> 
> It is really necessary to create a trigger and a table of log for
> each table that want to monitor?

If you can trust the software connecting to mysql, then you can do your
logging in the application as a separate INSERT statement just before
(or after) each query.  If you can not trust it (perhaps it is running
on a server you do not control) then you can't trust it to send the
logging queries.  Logging within a trigger is the safest way to ensure
that every query is logged when it is made.

Another alternative is to enable query logging and post-process that
log to determine what queries were run, and by whom.

-- 
	Dan Nelson
	dnelson@stripped
Thread
LogPedro Belmino23 Jul
  • Re: LogDan Nelson23 Jul
    • Re: LogPedro24 Jul
      • Re: LogDan Nelson24 Jul
      • RE: LogJerry Schwartz24 Jul
  • Re: LogPedro23 Jul