summaryrefslogtreecommitdiffstats
path: root/web/server/web_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'web/server/web_server.c')
-rw-r--r--web/server/web_server.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/web/server/web_server.c b/web/server/web_server.c
index b35fc252b..86c5dccf0 100644
--- a/web/server/web_server.c
+++ b/web/server/web_server.c
@@ -57,16 +57,16 @@ void debug_sockets() {
buffer_free(wb);
}
-void api_listen_sockets_setup(void) {
+bool api_listen_sockets_setup(void) {
int socks = listen_sockets_setup(&api_sockets);
if(!socks)
- fatal("LISTENER: Cannot listen on any API socket. Exiting...");
+ return false;
if(unlikely(debug_flags & D_WEB_CLIENT))
debug_sockets();
- return;
+ return true;
}
@@ -130,5 +130,18 @@ void web_client_update_acl_matches(struct web_client *w) {
// --------------------------------------------------------------------------------------
void web_server_log_connection(struct web_client *w, const char *msg) {
- netdata_log_access("%llu: %d '[%s]:%s' '%s'", w->id, gettid(), w->client_ip, w->client_port, msg);
+ ND_LOG_STACK lgs[] = {
+ ND_LOG_FIELD_U64(NDF_CONNECTION_ID, w->id),
+#ifdef ENABLE_HTTPS
+ ND_LOG_FIELD_TXT(NDF_SRC_TRANSPORT, SSL_connection(&w->ssl) ? "https" : "http"),
+#else
+ ND_LOG_FIELD_TXT(NDF_SRC_TRANSPORT, "http"),
+#endif
+ ND_LOG_FIELD_TXT(NDF_SRC_IP, w->client_ip),
+ ND_LOG_FIELD_TXT(NDF_SRC_PORT, w->client_port),
+ ND_LOG_FIELD_END(),
+ };
+ ND_LOG_STACK_PUSH(lgs);
+
+ nd_log(NDLS_ACCESS, NDLP_DEBUG, "[%s]:%s %s", w->client_ip, w->client_port, msg);
}