From 28594003364a8f93925756d826aac0a33b60520a Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Wed, 24 Sep 2014 17:40:04 +0200 Subject: [PATCH] Some debug stuff for the mongoose httpd - add a config-dump on log-level=info - add an access-log option use --prop:string:/sim/http/options/access-log-file="/path/to/access.log" --- src/Network/http/httpd.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Network/http/httpd.cxx b/src/Network/http/httpd.cxx index 75ca41af7..3fb280dc9 100644 --- a/src/Network/http/httpd.cxx +++ b/src/Network/http/httpd.cxx @@ -502,6 +502,16 @@ void MongooseHttpd::init() mg_set_option(_server, "idle_timeout_ms", n->getStringValue("idle-timeout-ms", "30000")); mg_set_option(_server, "index_files", n->getStringValue("index-files", "index.html")); mg_set_option(_server, "extra_mime_types", n->getStringValue("extra-mime-types", "")); + mg_set_option(_server, "access_log_file", n->getStringValue("access-log-file", "")); + + if( sglog().would_log(SG_NETWORK,SG_INFO) ) { + SG_LOG(SG_NETWORK,SG_INFO,"starting mongoose with these options: "); + const char ** optionNames = mg_get_valid_option_names(); + for( int i = 0; optionNames[i] != NULL; i+= 2 ) { + SG_LOG(SG_NETWORK,SG_INFO, " > " << optionNames[i] << ": '" << mg_get_option(_server, optionNames[i]) << "'" ); + } + SG_LOG(SG_NETWORK,SG_INFO,"end of mongoose options."); + } } -- 2.39.5