]> git.mxchange.org Git - flightgear.git/commitdiff
Some debug stuff for the mongoose httpd
authorTorsten Dreyer <torsten@ŧ3r.de>
Wed, 24 Sep 2014 15:40:04 +0000 (17:40 +0200)
committerTorsten Dreyer <torsten@ŧ3r.de>
Wed, 24 Sep 2014 15:40:04 +0000 (17:40 +0200)
- 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

index 75ca41af70623538f1929ea626a7882ecfc290b5..3fb280dc9df70e72474e13bc9baea0defea3cdfe 100644 (file)
@@ -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.");
+    }
 
   }