commit e9b108a

default  ·  2024-08-05 03:35:10 +0000 UTC
parent 78d34e4
Minor logging tweaks.
1 files changed,  +9, -6
+9, -6
 1@@ -763,6 +763,7 @@ void httpd(void)
 2 {
 3     const char *address;
 4     const char *port;
 5+    xs *full_address = NULL;
 6     int rs;
 7     pthread_t threads[MAX_THREADS] = {0};
 8     int n;
 9@@ -773,8 +774,10 @@ void httpd(void)
10     address = xs_dict_get(srv_config, "address");
11     port    = xs_number_str(xs_dict_get(srv_config, "port"));
12 
13+    full_address = xs_fmt("%s:%s", address, port);
14+
15     if ((rs = xs_socket_server(address, port)) == -1) {
16-        srv_log(xs_fmt("cannot bind socket to %s:%s", address, port));
17+        srv_log(xs_fmt("cannot bind socket to %s", full_address));
18         return;
19     }
20 
21@@ -791,13 +794,13 @@ void httpd(void)
22     signal(SIGTERM, term_handler);
23     signal(SIGINT,  term_handler);
24 
25-    srv_log(xs_fmt("httpd%s start %s:%s %s", p_state->use_fcgi ? " (FastCGI)" : "",
26-                    address, port, USER_AGENT));
27+    srv_log(xs_fmt("httpd%s start %s %s", p_state->use_fcgi ? " (FastCGI)" : "",
28+                    full_address, USER_AGENT));
29 
30     /* show the number of usable file descriptors */
31     struct rlimit r;
32     getrlimit(RLIMIT_NOFILE, &r);
33-    srv_debug(0, xs_fmt("available (rlimit) fds: %d (cur) / %d (max)",
34+    srv_debug(1, xs_fmt("available (rlimit) fds: %d (cur) / %d (max)",
35                         (int) r.rlim_cur, (int) r.rlim_max));
36 
37     /* initialize the job control engine */
38@@ -876,7 +879,7 @@ void httpd(void)
39 
40     xs *uptime = xs_str_time_diff(time(NULL) - p_state->srv_start_time);
41 
42-    srv_log(xs_fmt("httpd%s stop %s:%s (run time: %s)",
43+    srv_log(xs_fmt("httpd%s stop %s (run time: %s)",
44                 p_state->use_fcgi ? " (FastCGI)" : "",
45-                address, port, uptime));
46+                full_address, uptime));
47 }