diff options
-rw-r--r-- | web/apache/log | 11 | ||||
-rw-r--r-- | web/apache/service | 10 |
2 files changed, 13 insertions, 8 deletions
diff --git a/web/apache/log b/web/apache/log index 40523d3..7318e32 100644 --- a/web/apache/log +++ b/web/apache/log @@ -5,8 +5,9 @@ #ifndef WEB_APACHE_LOG #define WEB_APACHE_LOG -#include <httpd.h> // request_rec +#include <httpd.h> // request_rec #include <http_log.h> +#include <http_config.h> // module #include <cstdint> // uint64_t #include <algorithm> // min() @@ -21,7 +22,8 @@ namespace web { public: - log (server_rec* server) noexcept: server_ (server) {} + log (server_rec* s, const ::module* m) noexcept + : server_ (s), module_ (m) {} virtual void write (const char* msg) {write (APLOG_ERR, msg);} @@ -49,7 +51,7 @@ namespace web if (func) ap_log_error (file, line, - APLOG_NO_MODULE, + module_->module_index, level, 0, server_, @@ -61,7 +63,7 @@ namespace web // ap_log_error (file, line, - APLOG_NO_MODULE, + module_->module_index, level, 0, server_, @@ -71,6 +73,7 @@ namespace web private: server_rec* server_; + const ::module* module_; // Apache module. }; } } diff --git a/web/apache/service b/web/apache/service index 11f2ddb..75c096c 100644 --- a/web/apache/service +++ b/web/apache/service @@ -6,6 +6,7 @@ #define WEB_APACHE_SERVICE #include <httpd.h> +#include <http_config.h> // module, ap_hook_*() #include <string> #include <cassert> @@ -92,7 +93,7 @@ namespace web if (!parsed) { - log l (s); + log l (s, srv); srv->exemplar_.version (l); parsed = true; } @@ -104,8 +105,9 @@ namespace web static void worker_initializer (apr_pool_t*, server_rec* s) noexcept { - log l (s); - instance<M> ()->init_worker (l); + auto srv (instance<M> ()); + log l (s, srv); + srv->init_worker (l); } template <typename M> @@ -116,7 +118,7 @@ namespace web if (!r->handler || srv->name_ != r->handler) return DECLINED; request req (r); - log l (r->server); + log l (r->server, srv); return srv->template handle<M> (req, l); } |