summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/http/httpd.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-19 04:10:43 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-19 04:10:43 +0000
commit768a1e33e56c579edbcab1d4ea73d06b85cdd06c (patch)
tree5ea1f2c67ad34a17155c221711df7eff010034d2 /sca-cpp/trunk/modules/http/httpd.hpp
parentd4184f1ab86fd589126f3de2ed9fa433cf1b54b2 (diff)
Script fixes to get database working with the HTTPS-enabled store-cluster sample configuration. Also some logging improvements and aggregation of the sample logs using scribe.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@987012 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/http/httpd.hpp')
-rw-r--r--sca-cpp/trunk/modules/http/httpd.hpp54
1 files changed, 36 insertions, 18 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp
index 767af11cf9..ef89cbda0a 100644
--- a/sca-cpp/trunk/modules/http/httpd.hpp
+++ b/sca-cpp/trunk/modules/http/httpd.hpp
@@ -43,6 +43,7 @@
#include <util_script.h>
#include <util_md5.h>
#include <http_config.h>
+#include <http_log.h>
#include <ap_mpm.h>
#include <mod_core.h>
@@ -50,6 +51,7 @@
#include "stream.hpp"
#include "list.hpp"
#include "value.hpp"
+#include "monad.hpp"
namespace tuscany {
@@ -408,44 +410,60 @@ const void* userData(const string& k, const server_rec* s) {
/**
* Debug log.
*/
+
+/**
+ * Log an optional value.
+ */
const char* debugOptional(const char* s) {
if (s == NULL)
return "";
return s;
}
+/**
+ * Log a header
+ */
int debugHeader(unused void* r, const char* key, const char* value) {
- cerr << " header key: " << key << ", value: " << value << endl;
+ cdebug << " header key: " << key << ", value: " << value << endl;
return 1;
}
+/**
+ * Log an environment variable
+ */
int debugEnv(unused void* r, const char* key, const char* value) {
- cerr << " var key: " << key << ", value: " << value << endl;
+ cdebug << " var key: " << key << ", value: " << value << endl;
return 1;
}
+/**
+ * Log a note.
+ */
int debugNote(unused void* r, const char* key, const char* value) {
- cerr << " note key: " << key << ", value: " << value << endl;
+ cdebug << " note key: " << key << ", value: " << value << endl;
return 1;
}
+/**
+ * Log a request.
+ */
const bool debugRequest(request_rec* r, const string& msg) {
- cerr << msg << ":" << endl;
- cerr << " server: " << debugOptional(r->server->server_hostname) << endl;
- cerr << " protocol: " << debugOptional(r->protocol) << endl;
- cerr << " method: " << debugOptional(r->method) << endl;
- cerr << " method number: " << r->method_number << endl;
- cerr << " content type: " << contentType(r) << endl;
- cerr << " content encoding: " << debugOptional(r->content_encoding) << endl;
+ cdebug << msg << ":" << endl;
+ cdebug << " server: " << debugOptional(r->server->server_hostname) << endl;
+ cdebug << " protocol: " << debugOptional(r->protocol) << endl;
+ cdebug << " method: " << debugOptional(r->method) << endl;
+ cdebug << " method number: " << r->method_number << endl;
+ cdebug << " content type: " << contentType(r) << endl;
+ cdebug << " content encoding: " << debugOptional(r->content_encoding) << endl;
apr_table_do(debugHeader, r, r->headers_in, NULL);
- cerr << " unparsed uri: " << debugOptional(r->unparsed_uri) << endl;
- cerr << " uri: " << debugOptional(r->uri) << endl;
- cerr << " path info: " << debugOptional(r->path_info) << endl;
- cerr << " filename: " << debugOptional(r->filename) << endl;
- cerr << " uri tokens: " << pathTokens(r->uri) << endl;
- cerr << " args: " << debugOptional(r->args) << endl;
- cerr << " user: " << debugOptional(r->user) << endl;
- cerr << " auth type: " << debugOptional(r->ap_auth_type) << endl;
+ cdebug << " unparsed uri: " << debugOptional(r->unparsed_uri) << endl;
+ cdebug << " uri: " << debugOptional(r->uri) << endl;
+ cdebug << " path info: " << debugOptional(r->path_info) << endl;
+ cdebug << " filename: " << debugOptional(r->filename) << endl;
+ cdebug << " uri tokens: " << pathTokens(r->uri) << endl;
+ cdebug << " args: " << debugOptional(r->args) << endl;
+ cdebug << " user: " << debugOptional(r->user) << endl;
+ cdebug << " auth type: " << debugOptional(r->ap_auth_type) << endl;
apr_table_do(debugEnv, r, r->subprocess_env, NULL);
apr_table_do(debugEnv, r, r->notes, NULL);
return true;