Re: efficient log system
| From: | Richard Lynch | Date: | Tue, 12 Jun 2007 19:13:32 +0000 |
| Subject: | Re: efficient log system | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256754@lists.php.net to get a copy of this message | ||
On Tue, June 12, 2007 6:26 am, Alain Roger wrote:
> I would like to create a log system to keep a trace of all users'
> actions
> (log-in, remove, change or update data, and so on...).
> What should i do or to what should i take care to not have problem ?
>
> I was thinking to create a folder on my server where log files will be
> stored, but what is the best practice.
You probably can't get too much more efficient/reliable than a simple
http://php.net/error_log wrapped inside your own function to
make it
easier to hit the file you want.
You could dink around with logging into a database, perhaps, and that
has some benefits in terms of analysis queries.
If Performance is way more important than anything else, perhaps log
to a ram disk and sync that to a real hard drive in a cron job... But
you'd lose any recent activity in a crash or a really savvy attacker
might be able to "hide" activity by forcing the ram disk to fail or...
I wouldn't go down this route unless the other two have already
failed miserably.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?