Closed philipmclifton closed 9 years ago
Please note: My version might not work. need to look into it again.
Hi,
thanks for your suggestion.
i'm not a big fan of destructors. If somewhere during the request an error occurs nothing will get logged. This could also give some problems when running a long running script on the command line.
In most cases there will only be one or two activities that will be logged per request anyway, so I don't think the current method of logging poses a performance problem.
Hi, Nice work, everything works perfectly.
One suggestion.
Instead of creating an entry on every event and ramping up the database calls why not store all the events in an array and running a batch insert at the end of the request with the __destruct method?
On normal request this isn't an issue but if looping through data and creating entries the query count is 2x.
Something like this might work?
https://github.com/philipmclifton/activitylog