Re: [php-list] Rolling Road Log

2008-09-27 Thread Bob
- Original Message - From: <[EMAIL PROTECTED] > Hi Bob, > > Most of what I post is hand written code, often bugs and all! > > But that last script for php 4.x.x was straight off the php.net web site. > > I really don't spend any time with php 4.x.x any more. I looked to find one > of m

Re: [php-list] Rolling Road Log

2008-09-26 Thread listgroups08
- Original Message - From: "Bob" Hi Rob, Thanks very much for your help. I'm going to have to work though it at a later date. I'm just managing to check my email daily, and that's it at the moment. I transfer replies to my colour coded editor, then print them out for reference. I have n

Re: [php-list] Rolling Road Log

2008-09-26 Thread Bob
- Original Message - From: <[EMAIL PROTECTED]> > Hi Bob, > Below is the additional code for php version 4.x.x compatibility. > > The $_SERVER[REMOTE_PORT] was just a curiosity thing. > > Thanks, Rob. > > file_put_contnets for php < 5.x.x > > if ( !function_exists('file_put_c

Re: [php-list] Rolling Road Log

2008-09-26 Thread Patrick Bierans
> if ( !function_exists('file_put_contents') && !defined('FILE_APPEND') ) > { > define('FILE_APPEND', 1); > function file_put_contents($n, $d, $flag = false) > { > $mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? > 'a' : 'w'; > $f = @fopen($n, $mode); >

Re: [php-list] Rolling Road Log

2008-09-25 Thread listgroups08
- Original Message - From: "Bob" Hi Rob, I'm using PHP 4.4.4 (shared server so no choice, other than moving) so can't use file_put_contents(). You don't need to write me a complete program, just the concept and main points. I've got to do some of the work myself . I've never bothered r

Re: [php-list] Rolling Road Log

2008-09-25 Thread Bob
- Original Message - From: "Gordon Stewart" To: Sent: Thursday, September 25, 2008 8:11 AM Subject: Re: [php-list] Rolling Road Log > Personally, I have rolling logs - Not based on KB size -0 But based on > time > > > /logs/ <<< Basic log direc

Re: [php-list] Rolling Road Log

2008-09-25 Thread Bob
- Original Message - From: <[EMAIL PROTECTED]> > - Original Message - > From: "Bob" > > I used to use the following to log specific errors: > > But, this meant that sometimes there would only be a few errors shown, if > the file had reached it's 2 limit and deleted itself.

Re: [php-list] Rolling Road Log

2008-09-25 Thread Gordon Stewart
Personally, I have rolling logs - Not based on KB size -0 But based on time /logs/ <<< Basic log directory Then My main/central log script creates a subdirectory based on date... /logs/20080925/ (25th Sep 08) Then I store the logs in the new directory... (automatically creates a directo

Re: [php-list] Rolling Road Log

2008-09-24 Thread listgroups08
- Original Message - From: "Bob" <[EMAIL PROTECTED]> I used to use the following to log specific errors: But, this meant that sometimes there would only be a few errors shown, if the file had reached it's 2 limit and deleted itself. So I created a rolling road log of a 100. This al

Re: [php-list] Rolling Road Log

2008-09-24 Thread Bob
- Original Message - From: "Patrick Bierans" > Bob schrieb: >> I used to use the following to log specific errors: >> > $log = 'rejected'; >> if (filesize($log) > 2) unlink($log); >> $data = date('d-m-Y H:i:s')." [$fault]\r\n"; >> error_log($data,3,$log); >> ?> >> But, this meant that

Re: [php-list] Rolling Road Log

2008-09-24 Thread Patrick Bierans
Bob schrieb: > I used to use the following to log specific errors: > $log = 'rejected'; > if (filesize($log) > 2) unlink($log); > $data = date('d-m-Y H:i:s')." [$fault]\r\n"; > error_log($data,3,$log); > ?> > But, this meant that sometimes there would only be a few errors shown, if the > file

[php-list] Rolling Road Log

2008-09-24 Thread Bob
I used to use the following to log specific errors: 2) unlink($log); $data = date('d-m-Y H:i:s')." [$fault]\r\n"; error_log($data,3,$log); ?> But, this meant that sometimes there would only be a few errors shown, if the file had reached it's 2 limit and deleted itself. So I created a rol