cvs: /php4 main.c
| From: | Andrei Zmievski | Date: | Wed, 15 Dec 1999 17:37:36 +0000 |
| Subject: | cvs: /php4 main.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7953@lists.php.net to get a copy of this message | ||
andrei Wed Dec 15 12:37:36 1999 EDT
Modified files:
/php4 main.c
Log:
Added date/time stamping to PHP error log file. Idea credit goes
to Joey.
@ Added date/time stamping to PHP error log file. (Andrei, Joey)
Index: php4/main.c
diff -u php4/main.c:1.155 php4/main.c:1.156
--- php4/main.c:1.155 Mon Dec 13 19:01:08 1999
+++ php4/main.c Wed Dec 15 12:37:05 1999
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.155 1999/12/14 00:01:08 sas Exp $ */
+/* $Id: main.c,v 1.156 1999/12/15 17:37:05 andrei Exp $ */
#include <stdio.h>
@@ -289,6 +289,9 @@
void php3_log_err(char *log_message)
{
FILE *log_file;
+ char error_time_str[128];
+ struct tm tmbuf;
+ time_t error_time;
PLS_FETCH();
#if APACHE
SLS_FETCH();
@@ -304,6 +307,9 @@
#endif
log_file = fopen(PG(error_log), "a");
if (log_file != NULL) {
+ time(&error_time);
+ strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", localtime_r(&error_time,
&tmbuf));
+ fprintf(log_file, "[%s] ", error_time_str);
fprintf(log_file, log_message);
fprintf(log_file, "\n");
fclose(log_file);