Logs, logs everywhere, but which ones to keep? :)

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
AlanG
Forum Contributor
Posts: 136
Joined: Wed Jun 10, 2009 1:03 am

Logs, logs everywhere, but which ones to keep? :)

Post by AlanG »

I'm working on a audit logging system to tie into another system and am just wondering how detailed should I be with what I record?

I am using a MySQL archive storage engine and have an AuditLog object (with various derived classes).

So, should I log application wide actions, or just actions relevant to the business logic? As in ignore MySQL connections as the MySQL server is worrying about that?

I realise the answer to this really does depend on the context of the system; as there is some financial information being stored, logging is in paranoid mode there. :) Also, how many logs should be made per day before you start to rethink what's being stored? 100 logs a day is nothing, but 1000000 could cause some concern?

Maybe it doesn't matter at all... :S
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Logs, logs everywhere, but which ones to keep? :)

Post by josh »

Things like mysql errors should throw exceptions, uncaught exceptions should get logged to a special exception.log and/or emailed to the dev
Post Reply