Browse Source

set access_log = off

ithewei 2 years ago
parent
commit
23ed8fbe22
2 changed files with 7 additions and 1 deletions
  1. 2 1
      etc/httpd.conf
  2. 5 0
      examples/httpd/httpd.cpp

+ 2 - 1
etc/httpd.conf

@@ -29,8 +29,9 @@ document_root = html
 home_page = index.html
 #error_page = error.html
 index_of = /downloads/
-keepalive_timeout = 75000 #ms
+keepalive_timeout = 75000 # ms
 limit_rate = 500 # KB/s
+access_log = off
 cors = true
 
 # SSL/TLS

+ 5 - 0
examples/httpd/httpd.cpp

@@ -180,6 +180,11 @@ int parse_confile(const char* confile) {
     if (str.size() != 0) {
         g_http_service.limit_rate = atoi(str.c_str());
     }
+    // access_log
+    str = ini.GetValue("access_log");
+    if (str.size() != 0) {
+        g_http_service.enable_access_log = hv_getboolean(str.c_str());
+    }
     // cors
     if (ini.Get<bool>("cors")) {
         g_http_service.AllowCORS();