diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
commit | c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /web/server/web_server.c | |
parent | Adding upstream version 1.43.2. (diff) | |
download | netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.tar.xz netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.zip |
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/web_server.c')
-rw-r--r-- | web/server/web_server.c | 21 |
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); } |