diff options
| author | Zeev Suraski <zeev@php.net> | 2000-02-10 15:55:10 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2000-02-10 15:55:10 +0000 |
| commit | 404bbe1f265772bf495581d5914f866aaa5f4337 (patch) | |
| tree | edb92927088a2962bf6377a14d241dfe3edaadb4 /sapi/apache/mod_php4.c | |
| parent | 4a824eb8cb7fc1866dd793e8db6806aa860385ee (diff) | |
| download | php-git-404bbe1f265772bf495581d5914f866aaa5f4337.tar.gz | |
Move the logging mechanism to SAPI
Diffstat (limited to 'sapi/apache/mod_php4.c')
| -rw-r--r-- | sapi/apache/mod_php4.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 74bba3467e..c7ac6cd8c3 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -267,6 +267,23 @@ php_apache_startup(sapi_module_struct *sapi_module) } +static void php_apache_log_message(char *message) +{ + SLS_FETCH(); + + if (SG(server_context)) { +#if MODULE_MAGIC_NUMBER >= 19970831 + aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, message); +#else + log_error(message, ((requset_rec *) SG(server_context))->server); +#endif + } else { + fprintf(stderr, message); + fprintf(stderr, "\n"); + } +} + + static sapi_module_struct sapi_module = { "Apache", /* name */ @@ -287,6 +304,7 @@ static sapi_module_struct sapi_module = { sapi_apache_read_cookies, /* read Cookies */ sapi_apache_register_server_variables, /* register server variables */ + php_apache_log_message, /* Log message */ STANDARD_SAPI_MODULE_PROPERTIES }; |
